There was an error while loading. Please reload this page.
1 parent 453dc05 commit d55ad54Copy full SHA for d55ad54
1 file changed
graphs/directed_and_undirected_weighted_graph.py
@@ -425,8 +425,7 @@ def dfs(self, s=-2, d=-1):
425
s = stack.pop()
426
if visited.count(s) == 1:
427
continue
428
- else:
429
- visited.append(s)
+ visited.append(s)
430
# If reached d, return
431
if s == d:
432
break
0 commit comments