MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / dfs

Function dfs

graphs/scc_kosaraju.py:4–11  ·  view source on GitHub ↗
(u)

Source from the content-addressed store, hash-verified

2
3
4def dfs(u):
5 global graph, reversed_graph, scc, component, visit, stack
6 if visit[u]:
7 return
8 visit[u] = True
9 for v in graph[u]:
10 dfs(v)
11 stack.append(u)
12
13
14def dfs2(u):

Callers 1

kosarajuFunction · 0.70

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected