time Varies
space Varies
Target13
1
[0]
3
[1]
5
[2]
7
[3]
9
[4]
11
[5]
13
[6]
15
[7]
17
[8]
19
[9]
Begin searching for target 13 from the start of the array.
Pseudocode
Pseudocode
1function search(nums, target):
2 for i = 0 to nums.length - 1:
3 if nums[i] == target:
4 return i
5 return -1