mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
[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:
@ -4,6 +4,8 @@ A recursive implementation of the insertion sort algorithm
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List
|
||||
|
||||
|
||||
def rec_insertion_sort(collection: list, n: int):
|
||||
"""
|
||||
@ -70,6 +72,6 @@ def insert_next(collection: list, index: int):
|
||||
|
||||
if __name__ == "__main__":
|
||||
numbers = input("Enter integers separated by spaces: ")
|
||||
numbers = [int(num) for num in numbers.split()]
|
||||
rec_insertion_sort(numbers, len(numbers))
|
||||
print(numbers)
|
||||
number_list: List[int] = [int(num) for num in numbers.split()]
|
||||
rec_insertion_sort(number_list, len(number_list))
|
||||
print(number_list)
|
||||
|
Reference in New Issue
Block a user