title: How to build a k ary tree with array implementation in C?
body: <p>I'm working on an university project about k ary trees in C language. The exercise require to build a k ary tree as list and port it into an array. At the moment I can build the k ary tree as list successfully, now I'm trying to build a k ary tree with array implementation.</p>
  
  <p>Note that the structure of my k ary tree is made up by one child and "k" siblings.
  FOr example:</p>
  
  <pre><code>4 (root)
  .
  .
  5---6---23---98
      .
      .
      78---53---22---19
  </code></pre>
  
  <p>So, about array implementation of a k ary tree, I'm thinking to use something like:</p>
  
  <pre><code>typedef struct {
        int value;
        int children[MAX];
  } Karyarray;
  
  Karyarray array[MAX];
  </code></pre>
  
  <p>...but I don't know how to store eventually child (and siblings) that has a previous child as parent. I hope I've been clear. So, do you have a best approach to implement a k ary tree with array? Can you give me an example?</p>