📅  最后修改于: 2022-03-11 14:45:05.590000             🧑  作者: Mango
def topological_sort():
for each node:
if visited[node] is False:
dfs(node)
def dfs(node):
visited[node] = True
for nei in neighbours[node]:
dfs(node)
ret.insert_at_the _front(node)