Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions searches/linear_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ def linear_search(sequence: list, target: int) -> int:
return -1


if __name__ == "__main__":
import doctest

doctest.testmod()


def rec_linear_search(sequence: list, low: int, high: int, target: int) -> int:
"""
A pure Python implementation of a recursive linear search algorithm
Expand Down