gbhati
BAN USER
Comments (3)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 2 vote
Since the problem doesn't say that you cannot modify the tree.
Find both elements in tree and note their node pointers. Now, do a post order traversal where you convert the tree into a structure where each node's left ptr points to its parent.
Now it's simple finding out the intersection of the two linked list which start at the previously noted values
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
- gbhati May 01, 2012