Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'master' into fix-binary-search-final
  • Loading branch information
tusharynayaka authored Mar 18, 2026
commit 2662eb592893ea972fb44a31a51a97c105c38aaf
3 changes: 0 additions & 3 deletions machine_learning/linear_discriminant_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,6 @@ def accuracy(actual_y: list, predicted_y: list) -> float:
return (correct / len(actual_y)) * 100


num = TypeVar("num")


def valid_input[num](
input_type: Callable[[object], num], # Usually float or int
input_msg: str,
Expand Down
3 changes: 2 additions & 1 deletion searches/jump_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
from __future__ import annotations

import math
from collections.abc import Sequence
from typing import Any, Protocol


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


def jump_search[T: Comparable](arr: list[T], item: T) -> int:
def jump_search[T: Comparable](arr: Sequence[T], item: T) -> int:
"""
Python implementation of the jump search algorithm.
Return the index if the `item` is found, otherwise return -1.
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.