well in that case there can be simpler ways to do it do an inorder traversal while checking prev<cur<next ordering maintained if not then make it in proper order ,although whole tree has to be traversed to fix it.
*Shashi Kant * ***"Think positive and find fuel in failure"* http://thinkndoawesome.blogspot.com/ *System/Software Engineer* *Hewlett-Packard India Software Operations. * On Wed, Sep 5, 2012 at 12:43 PM, atul anand <[email protected]> wrote: > @Shashi : i dont see any difference....bcoz only 2 nodes are swapped > ..after correcting it...it shud maintain BST property wich automatically > retain original tree > > -- > 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. > -- 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.
