linearSearch(A, n, target)begin for i ← 0 to n-1 do if A[i] = target then return i return -1 // not foundendLinear Search: O(n) — must check each element sequentially
Binary Search: O(log n) — but requires sorted array
For this 10-element array: Linear checks up to 10 elements, Binary would check ~4