@navin : +1
On 6/30/12, Navin Gupta wrote:
> An unbalanced BST can be converted to a balanced BST in following 2-steps.
>
> 1:- Convert the tree to sorted circular doubly linked list.
> http://www.leetcode.com/2010/11/convert-binary-search-tree-bst-to.html
> The left children points to previous element and right children points
> to next element. -> O( N )
> 2:- Now convert the doubly linked list into tree recursively. ->O(N)
> http://www.geeksforgeeks.org/archives/17063
>
> Return the root of the new tree formed.--
>
> Navin Kumar Gupta
> Final Year,B.Tech(Hons.)
> Computer Science & Engg.
> National Institute of Technology,Jamshedpur
> Mobile - (+91)8285303045
>
> --
> 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/-/DxrZjNYzR_wJ.
> 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.