Tag Archives: Linear Search

Hackerearth: Linear Search Algorithm Problem

Default :
Source: https://www.hackerearth.com/practice/algorithms/searching/linear-search/tutorial/
code:

 

Algo: Linear Search

code:

Another Code By Me:

Complexity:
Best Case: O(1)
Worst Case: O(n)
Average Case: O(n/2)=O(n)
Source: http://quiz.geeksforgeeks.org/linear-search/

Pseudocode Looks Like this:

source: http://clrs.skanev.com/02/01/03.html

Another Good Pseudocode:

Source: