Skip to content

Commit ca1c615

Browse files
committed
fix: binary search first occurrence and resolve global ruff linting errors
1 parent 92204dc commit ca1c615

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

data_structures/hashing/hash_table_with_linked_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def __init__(self, *args, **kwargs):
88
super().__init__(*args, **kwargs)
99

1010
def _set_value(self, key, data):
11-
self.values[key] = deque([]) if self.values[key] is None else self.values[key]
11+
self.values[key] = deque() if self.values[key] is None else self.values[key]
1212
self.values[key].appendleft(data)
1313
self._keys[key] = self.values[key]
1414

machine_learning/linear_discriminant_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def accuracy(actual_y: list, predicted_y: list) -> float:
252252
num = TypeVar("num")
253253

254254

255-
def valid_input(
255+
def valid_input[num](
256256
input_type: Callable[[object], num], # Usually float or int
257257
input_msg: str,
258258
err_msg: str,

searches/jump_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __lt__(self, other: Any, /) -> bool: ...
2020
T = TypeVar("T", bound=Comparable)
2121

2222

23-
def jump_search(arr: Sequence[T], item: T) -> int:
23+
def jump_search[T](arr: Sequence[T], item: T) -> int:
2424
"""
2525
Python implementation of the jump search algorithm.
2626
Return the index if the `item` is found, otherwise return -1.

0 commit comments

Comments
 (0)