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
"Think positive and find fuel in failure"
+919985813081
+919966006652


On Tue, Jul 31, 2012 at 5:19 PM, Ishan Sood <sood.ishaan2...@gmail.com>wrote:

> 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.
> 9805660301
>
>
>
> 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 29, 2012 at 10:30 PM, Purani Sekar <nagapur...@gmail.com>wrote:
>>
>>> convert sorted doubly linked list to bst using same nodes as in DLL
>>
>>
>>  --
>> 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.
>>
>
>  --
> 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.
>

-- 
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.

Reply via email to