Skip to content

Add Topological Sort #1302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix topological sort?
  • Loading branch information
pmba committed Oct 10, 2019
commit 373eb48ef4122ac44bfdc4c0a51e4e7289326c32
8 changes: 4 additions & 4 deletions graphs/topological_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def top_sort(graph):
if not visited[v]:
dfs(v)


top_sort(graph)
print(stack)
print_stack(stack, clothes)
if __name__ == '__main__':
top_sort(graph)
print(stack)
print_stack(stack, clothes)