mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
black fixes and Travis CI fixes (#2160)
* black format
* updating DIRECTORY.md
* fixes
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@@ -5,24 +5,9 @@ Finding connected components in graph
|
||||
|
||||
"""
|
||||
|
||||
test_graph_1 = {
|
||||
0: [1, 2],
|
||||
1: [0, 3],
|
||||
2: [0],
|
||||
3: [1],
|
||||
4: [5, 6],
|
||||
5: [4, 6],
|
||||
6: [4, 5],
|
||||
}
|
||||
test_graph_1 = {0: [1, 2], 1: [0, 3], 2: [0], 3: [1], 4: [5, 6], 5: [4, 6], 6: [4, 5]}
|
||||
|
||||
test_graph_2 = {
|
||||
0: [1, 2, 3],
|
||||
1: [0, 3],
|
||||
2: [0],
|
||||
3: [0, 1],
|
||||
4: [],
|
||||
5: [],
|
||||
}
|
||||
test_graph_2 = {0: [1, 2, 3], 1: [0, 3], 2: [0], 3: [0, 1], 4: [], 5: []}
|
||||
|
||||
|
||||
def dfs(graph: dict, vert: int, visited: list) -> list:
|
||||
|
||||
@@ -5,22 +5,9 @@ Finding strongly connected components in directed graph
|
||||
|
||||
"""
|
||||
|
||||
test_graph_1 = {
|
||||
0: [2, 3],
|
||||
1: [0],
|
||||
2: [1],
|
||||
3: [4],
|
||||
4: [],
|
||||
}
|
||||
test_graph_1 = {0: [2, 3], 1: [0], 2: [1], 3: [4], 4: []}
|
||||
|
||||
test_graph_2 = {
|
||||
0: [1, 2, 3],
|
||||
1: [2],
|
||||
2: [0],
|
||||
3: [4],
|
||||
4: [5],
|
||||
5: [3],
|
||||
}
|
||||
test_graph_2 = {0: [1, 2, 3], 1: [2], 2: [0], 3: [4], 4: [5], 5: [3]}
|
||||
|
||||
|
||||
def topology_sort(graph: dict, vert: int, visited: list) -> list:
|
||||
|
||||
Reference in New Issue
Block a user