Goldman Sachs interview question

How to detect cycle in graph?

Interview Answer

Anonymous

22 Apr 2020

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