GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Notizen

Graph Algorithms

Chaitanya Sarda Computer Studies Interview Englisch 2 Seiten

Inhalt der Notizen (2)

Seite 1

Cycle detection in a directed and undirected graph differs. In a directed graph, we use DFS and store the currently visited nodes in a stack and find a back edge. whereas in a undirected graph, we just mark every node that we have visited as visited and when we visit an already visited node and this visited node is not the parent of the current node, then there is a cycle in the graph.

Detect Cycle in a Directed Graph : http://www.geeksforgeeks.org/detect-cycle-in-a-graph/

Time Complexity : O(E + V);

Detect Cycle in a Undirected Graph: http://www.geeksforgeeks.org/detect-cycle-undirected-graph/

Time Complexity : O(E + V);

Seite 2

Informationen

Beschreibung
Interview Computer Studies Notiz am Graph Algorithms, erstellt von Chaitanya Sarda am 13/08/2017.
Erstellt von
Chaitanya Sarda
Aufrufe
4
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck