IBM Interview Question

Question on Trees and Graphs