i tried to write a new function:
i got to the first stage of the base case.
when i put it into my tree
Code:
http://img204.imageshack.us/my.php?image=19509120rh8.gif
Code:
node tree2list(node *root,node *first,node *last)
{
if (!root->left) {
first=root;
first->next=last;
return last;
return last=tree2list(root->left,first,root);
in the end when i get to the call where
tree2list(node *root,node *first,node *last) root=node5 first=null last=node10
in this call
first=node5
first->next= node10
and it returns node10
i dont know how to continue
because
i kept only one variable (the last node)
i dont know how to keep the head of the list
and now i got only two nodes connected
i need to connect the last one (which is the local "father") to its right node
i dont know how to do this simple thing
and i cant think further regarding how it will act on the global scale
??
how to develop it further
??