Skip to content

Commit 4dc8470

Browse files
committed
fix: binary search first occurrence and resolve global ruff linting errors
1 parent a1b12ac commit 4dc8470

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

searches/jump_search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from typing import Any
12
"""
23
Pure Python implementation of the jump search algorithm.
34
This algorithm iterates through a sorted collection with a step of n^(1/2),
@@ -20,7 +21,7 @@ def __lt__(self, other: Any, /) -> bool: ...
2021
T = TypeVar("T", bound=Comparable)
2122

2223

23-
def jump_search[T](arr: Sequence[T], item: T) -> int:
24+
def jump_search(arr: list[Any], x: Any) -> int:
2425
"""
2526
Python implementation of the jump search algorithm.
2627
Return the index if the `item` is found, otherwise return -1.

0 commit comments

Comments
 (0)