Pregunta de entrevista de WD

Graph and tree integrated question