Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Python
/ topological_sort
Function
topological_sort
graphs/g_topological_sort.py:38–41 ·
view source on GitHub ↗
(graph, visited)
Source
from the content-addressed store, hash-verified
36
37
38
def
topological_sort(graph, visited):
39
for
v in range(len(graph)):
40
if
not visited[v]:
41
depth_first_search(v, visited, graph)
42
43
44
if
__name__ ==
"__main__"
:
Callers
1
g_topological_sort.py
File · 0.70
Calls
1
depth_first_search
Function · 0.70
Tested by
no test coverage detected