Pergunta de entrevista da empresa Cognizant

Some questions about graphs and trees