Skip to content

Commit

Permalink
comment improved
Browse files Browse the repository at this point in the history
  • Loading branch information
Ved Prakash Vishwakarma authored and Ved Prakash Vishwakarma committed Oct 20, 2024
1 parent e08aadd commit 2efd1f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sorts/topological_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ 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
#traversal from top to down in tree like graph (direction not given) we consider direction from top to down

Check failure on line 24 in sorts/topological_sort.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

sorts/topological_sort.py:24:89: E501 Line too long (111 > 88)
#current node encounter add it to the topo sort list
sort.append(current)

for neighbor in neighbors:
# if neighbor not in visited, visit
if neighbor not in visited:
Expand Down

0 comments on commit 2efd1f4

Please sign in to comment.