Tighten up psf/black and flake8 (#2024)

* Tighten up psf/black and flake8

* Fix some tests

* Fix some E741

* Fix some E741

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss
2020-05-22 08:10:11 +02:00
committed by GitHub
parent 21ed8968c0
commit 1f8a21d727
124 changed files with 583 additions and 495 deletions

View File

@ -1,7 +1,7 @@
# Finding Bridges in Undirected Graph
def computeBridges(l):
def computeBridges(graph):
id = 0
n = len(l) # No of vertices in graph
n = len(graph) # No of vertices in graph
low = [0] * n
visited = [False] * n
@ -9,7 +9,7 @@ def computeBridges(l):
visited[at] = True
low[at] = id
id += 1
for to in l[at]:
for to in graph[at]:
if to == parent:
pass
elif not visited[to]:
@ -28,7 +28,7 @@ def computeBridges(l):
print(bridges)
l = {
graph = {
0: [1, 2],
1: [0, 2],
2: [0, 1, 3, 5],
@ -39,4 +39,4 @@ l = {
7: [6, 8],
8: [5, 7],
}
computeBridges(l)
computeBridges(graph)