mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
Update radix_sort.py
This will fix the error in the list index showing as float
This commit is contained in:
parent
f9156cfb71
commit
aac224dc1b
@ -9,9 +9,9 @@ def radixsort(lst):
|
||||
buckets = [list() for _ in range( RADIX )]
|
||||
|
||||
# split lst between lists
|
||||
for i in lst:
|
||||
tmp = i / placement
|
||||
buckets[tmp % RADIX].append( i )
|
||||
for i in lst:
|
||||
tmp = int((i / placement) % RADIX)
|
||||
buckets[tmp].append(i)
|
||||
if maxLength and tmp > 0:
|
||||
maxLength = False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user