MCPcopy
hub / github.com/TheAlgorithms/JavaScript / dfsKosaraju

Method dfsKosaraju

Graphs/Kosaraju.js:59–67  ·  view source on GitHub ↗
(node, visited)

Source from the content-addressed store, hash-verified

57 }
58
59 dfsKosaraju(node, visited) {
60 visited.add(node)
61 this.stronglyConnectedComponents[
62 this.stronglyConnectedComponents.length - 1
63 ].push(node)
64 for (const child of this.reverseConnections[node]) {
65 if (!visited.has(child)) this.dfsKosaraju(child, visited)
66 }
67 }
68
69 kosaraju() {
70 // Function to perform Kosaraju Algorithm

Callers 1

kosarajuMethod · 0.95

Calls 3

addMethod · 0.45
pushMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected