Skip to content

Commit edcf6d5

Browse files
committed
#130 fixed radix sort for python 3
1 parent aa8485b commit edcf6d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: sorts/radix_sort.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ def radixsort(lst):
22
RADIX = 10
33
maxLength = False
44
tmp , placement = -1, 1
5-
5+
66
while not maxLength:
77
maxLength = True
88
# declare and initialize buckets
99
buckets = [list() for _ in range( RADIX )]
10-
10+
1111
# split lst between lists
1212
for i in lst:
13-
tmp = i / placement
13+
tmp = i // placement
1414
buckets[tmp % RADIX].append( i )
1515
if maxLength and tmp > 0:
1616
maxLength = False
17-
17+
1818
# empty lists into lst array
1919
a = 0
2020
for b in range( RADIX ):
2121
buck = buckets[b]
2222
for i in buck:
2323
lst[a] = i
2424
a += 1
25-
25+
2626
# move to next
2727
placement *= RADIX

0 commit comments

Comments
 (0)