Skip to content

Commit 9dea055

Browse files
committed
Add 2 pair words
1 parent 061093d commit 9dea055

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

graph/Edmonds-Karp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def BreadthFirstSearch(capacity, neighbors, flows, start, end):
4343
while queue:
4444
u = queue.pop(0)
4545
for v in neighbors[u]:
46-
# if there is available capacity and vis is not seen before in search
46+
# if there is available capacity and v is is not seen before in search
4747
if capacity[u][v] - flows[u][v] > 0 and parents[v] == -1:
4848
parents[v] = u
4949
# it will work because at the beginning M[u] is Infinity

strings/word-ladder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,7 @@ def h(v):
7373
G = WordSpace(wds)
7474
print G.ladder('lead', 'gold')
7575
print G.ladder('teamwork', 'vacation')
76+
print G.ladder('axe', 'pie')
77+
print G.ladder('axe', 'pie', h = lambda v: 0)
78+
print G.ladder('camera', 'harder')
79+
print G.ladder('camera', 'harder', h = lambda v: 0)

0 commit comments

Comments
 (0)