Hint: Use a map.
1330 Nearest Common Ancestors (3)
Warning: The input file is not well-formed and has some empty lines, which you will want to ignore.
3367 Expressions (3)
Hint: Compute the coordinates of each node first. Then, use the union-find data structure.
1785 Binary Search Heap Construction (5)
Find the root, divide-and-conquer.
Hint: Use the path compression idea we talked about while covering the union-find data structure.
2274 The Race (6)
3321 Apple Tree (6)
1175 Picture (7, challenge problem)
1195 Mobile phones (8, challenge problem)
2750 Potted Flower (9, challenge problem)