Pregunta de entrevista de NEC Corporation

Uni-directional graph question in Java