Pergunta de entrevista da empresa MathWorks

Don't remember exactly, but DFS Graph question