Back to Cosmos

Linear search

code/search/src/linear_search/README.md

latest543 B
Original Source

Linear search

The linear search is the simplest of the searching algorithms. The goal of the algorithm is check for existence of an element in the given array.

How it works

Linear search goes through each element of the given array until either the element to be searched is found or we have reached the end of the array.

Complexity

Time Complexity -> O(n)

Space Complexity -> O(1)


<p align="center"> A massive collaborative effort by <a href="https://github.com/OpenGenus/cosmos">OpenGenus Foundation</a> </p>