Dec 25, 2008

A tree without parent link, how to find out the path from a specific node to root

A tree without parent link, how to find out the path from a specific node to root

Use DFS (depth first search) to traverse the tree until the node is reached, ordering of the nodes in the stack is what we want.

No comments:

Post a Comment