psf/black code formatting (#1277)

This commit is contained in:
William Zhang
2019-10-05 01:14:13 -04:00
committed by Christian Clauss
parent 07f04a2e55
commit 9eac17a408
291 changed files with 6014 additions and 4571 deletions

View File

@ -17,8 +17,10 @@ def dfs(graph, start):
it off the stack."""
explored, stack = set(), [start]
while stack:
v = stack.pop() # one difference from BFS is to pop last element here instead of first one
v = (
stack.pop()
) # one difference from BFS is to pop last element here instead of first one
if v in explored:
continue
@ -30,11 +32,13 @@ def dfs(graph, start):
return explored
G = {'A': ['B', 'C'],
'B': ['A', 'D', 'E'],
'C': ['A', 'F'],
'D': ['B'],
'E': ['B', 'F'],
'F': ['C', 'E']}
G = {
"A": ["B", "C"],
"B": ["A", "D", "E"],
"C": ["A", "F"],
"D": ["B"],
"E": ["B", "F"],
"F": ["C", "E"],
}
print(dfs(G, 'A'))
print(dfs(G, "A"))