Question 1 of 5
A dock catalog stores crate IDs in a 1D array. Write a linear search that starts at index 0 and stops when the target is found.
public static int indexOf(int[] ids, int target)
{
/* complete the method */
}
(a) Write the loop and the equality test. (b) State what the method should return if the target is missing. (c) For {6, 1, 8, 1} and target 1, state the returned index and the number of comparisons.