Python Linear Search

Here you will get program for linear search in python.

Linear search is one of the simplest searching algorithm in which targeted item in sequentially matched with each item in a list. It is worst searching algorithm with worst case time complexity O (n).

Below is its implementation.

Linear Search

Image Source

Also Read: Python Binary Search

Program for Python Linear Search

Output

list of items is [5, 7, 10, 12, 15]
enter item to search:12
item found at position: 4

Comment below if you have any queries regarding python linear search program.

One thought on “Python Linear Search

Leave a Reply

Your email address will not be published. Required fields are marked *