Preparing your experience...
Loading scripts and resources
Preparing your experience...
Loading scripts and resources
4 steps. Step 1 'The Algorithm': def linear_search(arr, target): for i in range(len(arr)): if arr[i] == target: return i; return -1. Check each element, left to right, until found or end reached. Step 2 'Complexity': Best case: O(1) - target is first element. Worst case: O(n) - target is last or not
9
Likes
0
Remixes
0
Comments