Searching visualizer
Linear Search
Scan values one by one until the target is found.
Best O(1)Average O(n)Worst O(n)Space O(1)
Example Array
[3, 7, 12, 18, 25, 31, 44, 57, 63]Visualization
3
7
12
18
25
31
44
57
63
CurrentVisitedDiscardedFound
Metrics
Comparisons0
Visited0
Progress0%
Time taken0.0s
linearSearch(arr, target)for i from 0 to n - 1check arr[i]if arr[i] == targetreturn icontinue to next valuereturn -1