Skip to content

Commit aac224d

Browse files
authored
Update radix_sort.py
This will fix the error in the list index showing as float
1 parent f9156cf commit aac224d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sorts/radix_sort.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def radixsort(lst):
99
buckets = [list() for _ in range( RADIX )]
1010

1111
# split lst between lists
12-
for i in lst:
13-
tmp = i / placement
14-
buckets[tmp % RADIX].append( i )
12+
for i in lst:
13+
tmp = int((i / placement) % RADIX)
14+
buckets[tmp].append(i)
1515
if maxLength and tmp > 0:
1616
maxLength = False
1717

0 commit comments

Comments
 (0)