This can be done like this 1. find out the height of the tree 2. make the number of arrays(node* pointers)=height of tree 3. traverse the tree from root as arr0[0]=root; arr1[0]=root->left; arr1[1]=root->right arr2[0]=arr1[0]->left arr2[1]=arr1[1]->right . . . and so on note:- if any arr[n]==NULL then make corresponding left and right entries NULL too now make the tree entries as :- arr[n]->right=arr[n+1] if arr[n] is last entry of tree make its right node NULL
we are done :) On Sun, Jul 17, 2011 at 11:22 AM, naveen ms <[email protected]> wrote: > in this recursive code...the right link node will point to its sibling > to the right (if it has) or else it will be null. > the left link of the node will point to its child(if it has) or else > it will be null. > > regards, > Naveen > CSE > R.V.C.E, Bangalore. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
