| Learn | Algorithm - Searching - Linear search |
|---|
| Linear search Linear search is a simple algorithm. It loops through items until the query has been found, which makes it a linear algorithm - the complexity is O(n), where n is the number of items to go through. Why O(n)? In worst-case scenario, you have to go through all of the n items. It can be compared to looking for a book in a stack of books - you go through them all until you find the one that you want. Below is a Python implementation: |
Read Article
https://develop.horje.com/learn/1434/reference