Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sorts/bogo_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import random


def bogo_sort(collection: list) -> list:
def bogo_sort(collection: list[int]) -> list[int]:
"""Pure implementation of the bogosort algorithm in Python
:param collection: some mutable ordered collection with heterogeneous
comparable items inside
Expand All @@ -30,7 +30,7 @@ def bogo_sort(collection: list) -> list:
[-45, -5, -2]
"""

def is_sorted(collection: list) -> bool:
def is_sorted(collection: list[int]) -> bool:
for i in range(len(collection) - 1):
if collection[i] > collection[i + 1]:
return False
Expand Down
2 changes: 1 addition & 1 deletion sorts/unknown_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""


def merge_sort(collection):
def merge_sort(collection: list[int]) -> list[int]:
"""Pure implementation of the fastest merge sort algorithm in Python

:param collection: some mutable ordered collection with heterogeneous
Expand Down
Loading