Process tree in the level order traversal, but instead queue you mau
use partially constructed list of nodes (which will be the exact
result).
Remember the first node of the (i-1)-th level in the list. Process
nodes and add its child. And so on.


On Nov 24, 6:35 pm, vamsee marpu <[email protected]> wrote:
> Hi,
>
>  Can anybody help me in solving the following problem:
>
> Convert a binary search tree in to a doubly linked list in level order
> without using extra space :
>
>                                 BST
>                                    1
>                                   /  \
>                                  2   3
>                                 /  \ /  \
>                               4  5 6  7
>
> in to double linked list as:  1==2==3==4==5==6==7
>
> I can do it using level order traversal using a queue, but the problem says
> no extra space should be used, I tried a lot but can't able to figure out.
>
> Thanks,
> M. Vamsee

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

Reply via email to