Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-28 Thread Dhriti Khanna
@Navneet: I think only saving the preorder traversal will do. O(n). Inserting back into that order will give me the original tree back.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] Re: How to save a binary search tree space efficiently

2011-08-28 Thread Dhriti Khanna
@ Navneet: See if the tree is: 6 4 7 3 5 8 Then the preorder traversal is : 6 4 3 5 7 8 And using this preorder traversal and inserting them in the tree one by

Re: [algogeeks] Re: print all paths which sum up to a value.

2011-08-21 Thread Dhriti Khanna
void search_path( root , int i ) { static char str[100]; if(root == null) return; if( i == 0 ) str[i] = root-data; else str[i] = str[i-1] + root-data; // Maintaining the cumulative sum of all the sums till now. if ( str[i] == value )

Re: [algogeeks] Re: Microsoft written!!!

2011-08-09 Thread Dhriti Khanna
I think leftmost right cousin of 9 should be NULL. Because 8 is its immediate brother, and not cousin. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this