Pergunta de entrevista da empresa Amazon

Q1 from tree and q2 from graph(dfs/dsu)