diff --git a/searches/linear_search.py b/searches/linear_search.py index 8adb4a7015f0..b8d7d0a58094 100644 --- a/searches/linear_search.py +++ b/searches/linear_search.py @@ -8,8 +8,10 @@ python3 linear_search.py """ +from typing import Any -def linear_search(sequence: list, target: int) -> int: + +def linear_search(sequence: list[Any], target: Any) -> int: """A pure Python implementation of a linear search algorithm :param sequence: a collection with comparable items (sorting is not required for @@ -33,7 +35,7 @@ def linear_search(sequence: list, target: int) -> int: return -1 -def rec_linear_search(sequence: list, low: int, high: int, target: int) -> int: +def rec_linear_search(sequence: list[Any], low: int, high: int, target: Any) -> int: """ A pure Python implementation of a recursive linear search algorithm