Solution for Completing a Tree (tree)