title: Dynamic tree in C++
body: <p>I'd like to make a tree which can have some childrens in every node, but i don't know number of them. Tree have to be coded in small memory using (no extra data) with constant time to every node. I tought that i will make class Tree with value and children property (value is int, and children is stack) and array of pointers to every node in that Tree. My problem is to make this array. How can i make it with no extra data (<code>std::vector</code> sometimes allocate more memory than it needs) and constant time to every cell?</p>
  
  <p>Everything's ok, but i also need constant time to every node. I know how many nodes will be, but i dont know how to make array of every node. It should work something like:
  <code>
      array[n];<br>
      A_Node *array[0]= new A_Node(16);<br>
      A_Node *n = new A_Node(1);<br>
      array[0]->addChild(n);<br>
      array[1]=n;<br>
  </code>
  Or:
      *(array+1)=n;