Skip to content

Commit

Permalink
Merge pull request TheAlgorithms#157 from Sayan97/patch-1
Browse files Browse the repository at this point in the history
Update radix_sort.py
  • Loading branch information
harshildarji authored Nov 1, 2017
2 parents 991d09a + b96412c commit bb3287a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sorts/radix_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit bb3287a

Please sign in to comment.