Skip to content
Closed
Changes from all 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
5 changes: 1 addition & 4 deletions sorts/recursive_insertion_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
from __future__ import annotations

from collections.abc import MutableSequence
from typing import Protocol, TypeVar
from typing import Protocol


class Comparable(Protocol):
def __lt__(self, other: object, /) -> bool: ...


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


def rec_insertion_sort[T: Comparable](collection: MutableSequence[T], n: int) -> None:
"""
Given a collection of comparable elements and its length, sorts the
Expand Down
Loading