searches.sentinel_linear_search =============================== .. py:module:: searches.sentinel_linear_search .. autoapi-nested-parse:: This is pure Python implementation of sentinel linear search algorithm For doctests run following command: python -m doctest -v sentinel_linear_search.py or python3 -m doctest -v sentinel_linear_search.py For manual testing run: python sentinel_linear_search.py Attributes ---------- .. autoapisummary:: searches.sentinel_linear_search.user_input Functions --------- .. autoapisummary:: searches.sentinel_linear_search.sentinel_linear_search Module Contents --------------- .. py:function:: sentinel_linear_search(sequence, target) Pure implementation of sentinel linear search algorithm in Python :param sequence: some sequence with comparable items :param target: item value to search :return: index of found item or None if item is not found Examples: >>> sentinel_linear_search([0, 5, 7, 10, 15], 0) 0 >>> sentinel_linear_search([0, 5, 7, 10, 15], 15) 4 >>> sentinel_linear_search([0, 5, 7, 10, 15], 5) 1 >>> sentinel_linear_search([0, 5, 7, 10, 15], 6) .. py:data:: user_input