@sharad :  In which order you will make the tree into doubly linklist ??

another algorithm:
1. keep root value as 0
2. when moving left decrement this value and assign to node
3. when moving right increment the value and assign to node
4. now sort the nodes on this number basis and if this number is same then
on level basis

eg:
                                             1
                                           /    \
                                          2      3
                                        /   \    /  \
                                       4    5  6    7
1 -> 0
2 -> -1
3 -> 1
4 -> -2
5 -> 0
6 -> 0
7 -> 2
sort : 4 2 1 5 6 3 7

any comments???

-- 
Regards
Jitendra Kushwaha
MNNIT, Allahabad

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@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