struct avail
{
int value;
avail **child;
};
avail *n = new avail;
n->child = new avail*[25];
for (int i = 0; i < 25; i++)
n->child[i] = new avail;
This is my solution to generating dynamictrees.But I need to specify the no at the start(25). But for further code I want this to be done dynamically something along the lines of
push(avail(n->child[newindex]))
Or
n->child[29]=new avail;
I want to add nodes on a need basis and create proper hierarchy.I would have used stacks for this but I want parent child relation between the nodes. I want to avoid using vectors to complicate the code.