Skip to content

Commit 7a2ee6e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e3c6e81 commit 7a2ee6e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sorts/topological_sort.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
}
1515
vertices: list[str] = ["a", "b", "c", "d", "e"]
1616

17+
1718
class Topo:
1819
def topo_sort(self):
1920
visited = set()
2021
stack = []
22+
2123
def dfs(node):
2224
visited.add(node)
2325

@@ -26,9 +28,9 @@ def dfs(node):
2628
dfs(neighbor)
2729

2830
stack.append(node)
29-
31+
3032
return stack
31-
33+
3234
result = dfs("a")
3335
return result[::-1]
3436

0 commit comments

Comments
 (0)