Skip to content

Commit 2cf5014

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c204bca commit 2cf5014

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

sorts/shell_sort.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
https://en.wikipedia.org/wiki/Shellsort#Pseudocode
33
"""
4+
45
from typing import Any, Protocol, TypeVar
56

67

@@ -10,6 +11,7 @@ def __lt__(self, other: Any, /) -> bool: ...
1011

1112
T = TypeVar("T", bound=Comparable)
1213

14+
1315
def shell_sort[T: Comparable](collection: list[T]) -> list[T]:
1416
"""Pure implementation of shell sort algorithm in Python
1517
:param collection: Some mutable ordered collection with heterogeneous
@@ -31,7 +33,7 @@ def shell_sort[T: Comparable](collection: list[T]) -> list[T]:
3133
...
3234
TypeError: '>' not supported between instances of 'int' and 'str'
3335
"""
34-
# Marcin Ciura's gap sequence
36+
# Marcin Ciura's gap sequence
3537
gaps = [701, 301, 132, 57, 23, 10, 4, 1]
3638
for gap in gaps:
3739
for i in range(gap, len(collection)):

0 commit comments

Comments
 (0)