Function
gatherScc
(
graph: number[][],
visited: boolean[],
node: number,
scc: number[]
)
Source from the content-addressed store, hash-verified
| 35 | |
| 36 | // Computes the SCC that contains the given node |
| 37 | const gatherScc = ( |
| 38 | graph: number[][], |
| 39 | visited: boolean[], |
| 40 | node: number, |
| 41 | scc: number[] |
| 42 | ) => { |
| 43 | if (visited[node]) { |
| 44 | return |
| 45 | } |
| 46 | visited[node] = true |
| 47 | scc.push(node) |
| 48 | |
| 49 | for (const dest of graph[node]) { |
| 50 | gatherScc(graph, visited, dest, scc) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * @function kosajaru |
Tested by
no test coverage detected