Learn Linear Search through interactive step-by-step animations. Watch the algorithm scan each element sequentially to find the target.
Linear search is the simplest search algorithm. It sequentially checks each element of the list until a match is found or the whole list has been searched.
Begin with the very first element in the array (index [0]).
Compare the element at the current index with the target value. If they match, search succeeds.
If no match, increment index and check the next element. Repeat until target is found or end is reached.
Linear search rarely used in practice for large arrays because other search algorithms like binary search are much faster. However, it is the only viable option if the list is unsorted.