Skip to content

Fix: #12192 #12203

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
Issue 12192 fixed with all checks passed
  • Loading branch information
Ved Prakash Vishwakarma authored and Ved Prakash Vishwakarma committed Oct 20, 2024
commit 239b8c83e4117b1cb9bffe553a5e1a9e54edf2bd
4 changes: 2 additions & 2 deletions sorts/topological_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def topological_sort(start: str, visited: list[str], sort: list[str]) -> list[st
# add current to visited
visited.append(current)
neighbors = edges[current]
#as we are traversing in from top to down in tree like graph (direction not given) we consider direction from top to down
#as the current node encounter add it to the topo sort list
# direction not given so consider from top to bottom
# as the current node encounter add it to the topo sort list
sort.append(current)
for neighbor in neighbors:
# if neighbor not in visited, visit
Expand Down