@atul

two nodes were given in the qstn.......

i did

1) calculate the level of one node through level order traversal similarly
for other
2) then find the Least Common Anscestor
3) then dist(LCS - node1) + dist(LCS - node2)

but i think this was not optimized bcse he was not very much satisfied by
this

So if any of you know some bettr approach then please tell

thanks a lot :)

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