MCPcopy 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
38def 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
44if __name__ == "__main__":

Callers 1

Calls 1

depth_first_searchFunction · 0.70

Tested by

no test coverage detected