Pergunta de entrevista da empresa NEC Corporation

Uni-directional graph question in Java