X915: Big O - 4

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 Answer:

Select one answer:


Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.