Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions searches/linear_search.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This is pure Python implementation of linear search algorithm
This is a pure Python implementation of the linear search algorithm.

For doctests run following command:
python3 -m doctest -v linear_search.py
Expand All @@ -11,9 +11,8 @@

def linear_search(sequence: list, target: int) -> int:
"""A pure Python implementation of a linear search algorithm

:param sequence: a collection with comparable items (as sorted items not required
in Linear Search)
:param sequence: a collection with comparable items (sorting is not required for
linear search)
:param target: item value to search
:return: index of found item or -1 if item is not found

Expand Down