Update radix_sort.py

This will fix the error in the list index showing as float
This commit is contained in:
Sayan Bandyopadhyay 2017-10-12 01:28:12 +05:30 committed by GitHub
parent f9156cfb71
commit aac224dc1b

View File

@ -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