diff --git a/search.py b/search.py index c3f128c..e0f9cff 100644 --- a/search.py +++ b/search.py @@ -26,6 +26,10 @@ def linear(data: List[Any], target: Any, comparator: Callable[[Any, Any], bool]) Performs a linear search through the list. Returns the index of the target, or -1 if not found. """ + for i, item in enumerate(data): + if comparator(item, target): + return i + return -1 pass # =====================