mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-24 13:31:07 +00:00
Modernize Python 2 code to get ready for Python 3
This commit is contained in:
parent
e31c780d94
commit
ad6b0f1c6b
|
@ -187,8 +187,8 @@ def adjm():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def floy(xxx_todo_changeme):
|
def floy(A_and_n):
|
||||||
(A, n) = xxx_todo_changeme
|
(A, n) = A_and_n
|
||||||
dist = list(A)
|
dist = list(A)
|
||||||
path = [[0] * n for i in xrange(n)]
|
path = [[0] * n for i in xrange(n)]
|
||||||
for k in xrange(n):
|
for k in xrange(n):
|
||||||
|
@ -259,9 +259,9 @@ def edglist():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def krusk(xxx_todo_changeme1):
|
def krusk(E_and_n):
|
||||||
# Sort edges on the basis of distance
|
# Sort edges on the basis of distance
|
||||||
(E, n) = xxx_todo_changeme1
|
(E, n) = E_and_n
|
||||||
E.sort(reverse=True, key=lambda x: x[2])
|
E.sort(reverse=True, key=lambda x: x[2])
|
||||||
s = [set([i]) for i in range(1, n + 1)]
|
s = [set([i]) for i in range(1, n + 1)]
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user