Skip to content

Commit 2efd1f4

Browse files
Ved Prakash VishwakarmaVed Prakash Vishwakarma
Ved Prakash Vishwakarma
authored and
Ved Prakash Vishwakarma
committed
comment improved
1 parent e08aadd commit 2efd1f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: sorts/topological_sort.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ def topological_sort(start: str, visited: list[str], sort: list[str]) -> list[st
2121
# add current to visited
2222
visited.append(current)
2323
neighbors = edges[current]
24-
#as we are traversing in from top to down in tree like graph (direction not given) we consider direction from top to down
25-
#as the current node encounter add it to the topo sort list
24+
#traversal from top to down in tree like graph (direction not given) we consider direction from top to down
25+
#current node encounter add it to the topo sort list
2626
sort.append(current)
27+
2728
for neighbor in neighbors:
2829
# if neighbor not in visited, visit
2930
if neighbor not in visited:

0 commit comments

Comments
 (0)