we can go for bottom up approch .so go the leftmost leaf node and then
pass this node as a root to the function which implements AVL rotations.Do
the same as we move back in the recursion i guess this will work as we
are balancing the the left and right subtree of node say X before we move
back.
On Wed, Jun 27, 2012 at 10:32 PM, Krishna Kishore
kknarenkris...@gmail.comwrote:
Suppose a Binary Search Tree which is unbalanced.is given. Write a
routine to balance the Binary Search Tree.
Send the Root of the BST as an argument to that routine. It has to Return
the Root of the Balanced BST.
Thanks In Advance.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/iYdbt5mI4BQJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.