Repository commit
f5988cc
Python version (python --version)
Python 3.14.6
Dependencies version (pip freeze)
N/A (Standard Library only)
Expected behavior
jump_search([], 5) should return -1 when given an empty list or sequence, as an empty collection cannot contain the target search item.
Actual behavior
Calling jump_search([], 5) raises an IndexError: list index out of range:
Traceback (most recent call last):
File "searches/jump_search.py", line 43, in jump_search
while arr[min(step, arr_size) - 1] < item:
IndexError: list index out of range
Repository commit
f5988cc
Python version (python --version)
Python 3.14.6
Dependencies version (pip freeze)
N/A (Standard Library only)
Expected behavior
jump_search([], 5)should return-1when given an empty list or sequence, as an empty collection cannot contain the target search item.Actual behavior
Calling
jump_search([], 5)raises anIndexError: list index out of range: