Multiple Choice
Suppose you wish to sort an array list of objects, but the object class does not implement the Comparable interface. Because you are not allowed to modify this class, you decide to provide a comparator object that implements the Comparator interface. Which method must you implement from this interface to achieve your objective?
A) the sort method.
B) the compare method.
C) the compareTo method.
D) the compareObject method.
Correct Answer:

Verified
Correct Answer:
Verified
Q24: Which of the sorts in the textbook
Q25: Selection sort has O(n<sup>2</sup>) complexity. If a
Q26: In each iteration, selection sort places which
Q27: A binary search is generally _ a
Q28: Suppose the call obj1.compareTo(obj2) returns 0. What
Q30: In the textbook, we found that the
Q31: How many times can an array with
Q32: Consider the sort method shown below for
Q33: If you implement a recursive linear search,
Q34: Given the following code snippet for searching