0
/ 10
The code below finds a specific number in an int
array. What is the worst case estimation for performance, Big O(), for this method?
...
The code below finds a specific number in an
int
array. What is the worst case estimation
for performance, Big O(), for this method?
static int find(int[] nums, int looking)
{
for (int i = 0; i < nums.length; i++) {
if (nums[i] == looking)
return i;
}
return -1;
}
Your feedback will appear here when you check your answer.