Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-08-05 Thread Avinash Mishra
http://www.geeksforgeeks.org/archives/17629 On 2 August 2012 19:50, Daksh Talwar dakshtal...@gmail.com wrote: When asked , try to make the most balanced one . otherwise there are many possible BSTs for a given array/linked list. On Thu, Aug 2, 2012 at 5:05 PM, Umer Farooq

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-08-03 Thread Daksh Talwar
When asked , try to make the most balanced one . otherwise there are many possible BSTs for a given array/linked list. On Thu, Aug 2, 2012 at 5:05 PM, Umer Farooq the.um...@gmail.com wrote: A LinkedList is by itself is a BST such that one child node of each node is null. Do we need a simple

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-08-02 Thread Umer Farooq
A LinkedList is by itself is a BST such that one child node of each node is null. Do we need a simple BST or height balanced BST? On Tue, Jul 31, 2012 at 2:39 PM, Ashish Goel ashg...@gmail.com wrote: how would you do convert sorted doubly linked list to bst using same nodes as in DLL Best

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-08-02 Thread Ashish Goel
Ishan, i am assuming that the list to BST should give a inorder traversal, and the logic of yours does not seem to give a right solution. try two different trees with 7 nodes, convert into LL and then back to BST, the answer is not same as the trees that we start with. Best Regards Ashish Goel

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-08-02 Thread Ashish Goel
can you give the link within geeksforgeeks please Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Tue, Jul 31, 2012 at 4:13 PM, a g ag20071...@gmail.com wrote: check on geeksforgeeks.org On Tue, Jul 31, 2012 at 3:09 PM, Ashish Goel

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-07-31 Thread Ashish Goel
how would you do convert sorted doubly linked list to bst using same nodes as in DLL Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sun, Jul 29, 2012 at 10:30 PM, Purani Sekar nagapur...@gmail.com wrote: convert sorted doubly linked list to bst

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-07-31 Thread a g
check on geeksforgeeks.org On Tue, Jul 31, 2012 at 3:09 PM, Ashish Goel ashg...@gmail.com wrote: how would you do convert sorted doubly linked list to bst using same nodes as in DLL Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Sun, Jul

Re: [algogeeks] Re: Microsoft online questions : DLL to bst??

2012-07-31 Thread Ishan Sood
1. get the middle of the linked list and make it root 2. same for left half and right half recursivly a. get the middle of left half and make it left child. b. get middle of rite half and make it rite child. this is must b he logic for the qstn. :) Thank You, Ishan Sood.