Skip to content

Commit bb3287a

Browse files
authored
Merge pull request #157 from Sayan97/patch-1
Update radix_sort.py
2 parents 991d09a + b96412c commit bb3287a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sorts/radix_sort.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ 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)
15+
1516
if maxLength and tmp > 0:
1617
maxLength = False
1718

0 commit comments

Comments
 (0)