@ Rajesh: there may be a problem with this solution. Suppose I start detaching the nodes from the binary tree in the following order - > Root, Left, Right. So as soon as i detach the root of the binary tree and form a new BST with it ( on which i m going to make further node additions), I am left with 2 sub trees ( the left subtree & the right one). So i must have a way to manage them. We'll have to use a queue for that but this will lead to extra space utilization.
On Wed, Apr 28, 2010 at 3:30 PM, Rajesh Patidar <[email protected]>wrote: > pickup node in any order no matter(pre,post,inorder) and just one by > one. start adding the node into bst no need to use extra space u have > to just ditach the node from binary tree and attach it in bst. > > On Wed, Apr 28, 2010 at 1:18 AM, Ashish Mishra <[email protected]> > wrote: > > How to build BST from binary tree in place i.e without extra space ?? > > > > -- > > 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]<algogeeks%[email protected]> > . > > For more options, visit this group at > > http://groups.google.com/group/algogeeks?hl=en. > > > > > > -- > ~~~~BL/\CK_D!AMOND~~~~~~~~ > > -- > 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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- 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.
