Merge pull request #157 from Sayan97/patch-1

Update radix_sort.py
This commit is contained in:
Harshil 2017-11-01 10:49:05 +05:30 committed by GitHub
commit bb3287ac0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,9 +9,10 @@ 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