Skip to content

Commit 51e1da2

Browse files
Littlecowherdstokhos
authored andcommitted
Fix bugs and add related tests (TheAlgorithms#2375)
1 parent 2e488d2 commit 51e1da2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sorts/radix_sort.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ def radix_sort(list_of_ints: List[int]) -> List[int]:
77
True
88
radix_sort(reversed(range(15))) == sorted(range(15))
99
True
10+
radix_sort([1,100,10,1000]) == sorted([1,100,10,1000])
11+
True
1012
"""
1113
RADIX = 10
1214
placement = 1
1315
max_digit = max(list_of_ints)
14-
while placement < max_digit:
16+
while placement <= max_digit:
1517
# declare and initialize empty buckets
1618
buckets = [list() for _ in range(RADIX)]
1719
# split list_of_ints between the buckets

0 commit comments

Comments
 (0)