Pregunta de entrevista de Glencore

a graph and tree question