← Back to Arrays
Linear Search Visualization
Linear Search checks each element sequentially until the target is found or the entire array is searched.
Time Complexity
Best: O(1)
Average: O(n)
Worst: O(n)
Space
O(1)
Comparisons
0
Status
Ready
500ms
Searching for: 42 |Yellow: CurrentRed: CheckedGreen: Found
How Linear Search Works
- • Start from the first element
- • Compare with target value
- • If found, return the index
- • Otherwise, move to next element
- • Continue until found or end reached
Key Properties
- • Simple: Easy to understand and implement
- • Works on unsorted data: No pre-sorting required
- • Sequential: Checks elements one by one
- • Guaranteed: Will find element if it exists