Skip to content

Commit

Permalink
Fix bugs and add related tests (TheAlgorithms#2375)
Browse files Browse the repository at this point in the history
  • Loading branch information
Littlecowherd authored and stokhos committed Jan 3, 2021
1 parent 2e488d2 commit 51e1da2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sorts/radix_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ def radix_sort(list_of_ints: List[int]) -> List[int]:
True
radix_sort(reversed(range(15))) == sorted(range(15))
True
radix_sort([1,100,10,1000]) == sorted([1,100,10,1000])
True
"""
RADIX = 10
placement = 1
max_digit = max(list_of_ints)
while placement < max_digit:
while placement <= max_digit:
# declare and initialize empty buckets
buckets = [list() for _ in range(RADIX)]
# split list_of_ints between the buckets
Expand Down

0 comments on commit 51e1da2

Please sign in to comment.