How can you find a cycle in a graph? — DFS. If you discover an edge that connects to an ancestor (previously discovered vertex), you have a cycle.
G
1.2K
Google Interview
This flashcard deck made by jwasham contains knowledge about google interview. For more details, please follow https://github.com/jwasham/google-interview-university