Skip to main content

String Vis

Interactive Strings
10
0
25
1
30
2
45
3
50
4
65
5
70
6
85
7
90
8
1x
Algorithm Details
Time Complexity
BestO(1)
AverageO(n)
WorstO(n)

Checks each element sequentially until the target is found or the end is reached.

Algorithm Logic
1Algorithm LinearSearch(array, target):
2 For each index i from 0 to length - 1:
3 If array[i] == target:
4 Return i (Found)
5
6 Return -1 (Not Found)