[mypy]Correction of all errors in the sorts directory (#4224)

* [mypy] Add/fix type annotations for recursive_insertion_sort(#4085)

* [mypy] Add/fix type annotations for bucket_sort(#4085)

* [mypy] Reworked code for cocktail_shaker_sort so that missing return statement error is resolved(#4085)

* [mypy] Add/fix type annotations for patience_sort(#4085)

* [mypy] Add/fix type annotations for radix_sort(#4085)

Co-authored-by: goodm2 <4qjpngu8mem8cz>
This commit is contained in:
Matthew
2021-02-23 09:02:30 +00:00
committed by GitHub
parent 02d9bc66c1
commit a4726ca248
5 changed files with 12 additions and 7 deletions

View File

@ -30,7 +30,7 @@ def radix_sort(list_of_ints: List[int]) -> List[int]:
max_digit = max(list_of_ints)
while placement <= max_digit:
# declare and initialize empty buckets
buckets = [list() for _ in range(RADIX)]
buckets: List[list] = [list() for _ in range(RADIX)]
# split list_of_ints between the buckets
for i in list_of_ints:
tmp = int((i / placement) % RADIX)