Assume int[] scores = {1, 20, 30, 40, 50}, what value does java.util.Arrays.binarySearch(scores, 3) return?

a. 0
b. -1
c. 1
d. 2
e. -2


e The binarySearch method returns the index of the search key if it is contained in the list. Otherwise, it returns –insertion point - 1 . The insertion point is the point at which the key would be inserted into the list. In this case the insertion point is 1 . Note that the array index starts from 0.

Computer Science & Information Technology

You might also like to view...

On the Tools panel, the default foreground color is ____.

a. black b. white c. light blue d. gray

Computer Science & Information Technology

Include the saved data in your lab report.

What will be an ideal response?

Computer Science & Information Technology

When emailing, how many topics should you limit each individual email to?

a. no more than 3 b. only 1 c. any number is fine as long as you explain each one in detail d. it depends on the recipient

Computer Science & Information Technology

From the vertical scroll bar, what displays as you move the scroll box?

A) the slide theme B) the notes C) a ScreenTip D) the slide content

Computer Science & Information Technology