How to determine if there is a cycle in the graph
If the graph is undirected Bfs + hashtable (bitvector)
If the graph is directed, dfs the tree and each node has a visited value, where 0 is unvisited, 1 is visiting or 2 is finished, you can see clrs p458
Showing posts with label graph. Show all posts
Showing posts with label graph. Show all posts
Subscribe to:
Posts (Atom)