mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-09 13:45:22 +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:
@ -1,6 +1,7 @@
|
||||
from bisect import bisect_left
|
||||
from functools import total_ordering
|
||||
from heapq import merge
|
||||
from typing import List
|
||||
|
||||
"""
|
||||
A pure Python implementation of the patience sort algorithm
|
||||
@ -43,7 +44,7 @@ def patience_sort(collection: list) -> list:
|
||||
>>> patience_sort([-3, -17, -48])
|
||||
[-48, -17, -3]
|
||||
"""
|
||||
stacks = []
|
||||
stacks: List[Stack] = []
|
||||
# sort into stacks
|
||||
for element in collection:
|
||||
new_stacks = Stack([element])
|
||||
|
Reference in New Issue
Block a user