?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Easy

Binary Search Algorithm and Typical Precondition

APCSA-1VADNX

A student wants to create a binary search algorithm that uses an ArrayList of Strings.

Which of the following is a typical precondition?

A

The Strings in the ArrayList must be composed of all uppercase or all lowercase letters.

B

The Strings in the ArrayList must be composed of the same number of characters.

C

The String being searched for must be contained in the ArrayList.

D

The ArrayList must be sorted.

E

The ArrayList must be of even size.