Goldman Sachs Interview Question

How to detect cycle in graph?

Interview Answer

Anonymous

Apr 22, 2020

DFS, remembering from which node you got to the next node.