Each node in the tree has a pointer to parent and pointers to all children nodes. On input you received two nodes from the tree and your algorithm has to return closest common node between these two nodes.
Clone directed graph. The input to the algorithm is one of the nodes of the graph which contains a list of its adjacent nodes. Assume you can navigate visit all renaming nodes in the graph from the node that you are given. Your function has to return pointer to cloned graph.