Pergunta de entrevista da empresa Siemens Digital Industries Software

DFS and BFS algorithm question (leet code medium)