Algorithm Visualizer

Linear Search


Linear search is a straightforward method for finding a specific item in a list. It works by checking each item in the list one at a time, from the beginning to the end, until the desired item is found or the end of the list is reached.

TIME COMPLEXITY: O(N)What is time complexity?

PSEUDO CODE:

for (let i = 0; i < arr.length; i++)

if(arr[i] === key) return i