Multiple Choice
When your class implements a comparator object, you must implement the compare method. What must be true about the return value from this method when comparing two objects, a and b with a call to a.compare(b) ?
A) It must return 1 if a comes before b, 0 if they are the same, and -1 if a comes after b.
B) It must return -1 if a comes before b, 0 if they are the same, and 1 if a comes after b.
C) It must return a positive value if a comes before b, 0 if they are the same, and a negative value if a comes after b.
D) It must return a negative value if a comes before b, 0 if they are the same, and a positive value if a comes after b.
Correct Answer:

Verified
Correct Answer:
Verified
Q51: Find the simplest order of growth of
Q52: If you increase the size of a
Q53: After 5 iterations of selection sort working
Q54: Which of the following completes the selection
Q55: Choose the order of the following growth
Q57: Which notation, big-Oh, theta, or omega describes
Q58: Binary search is an _ algorithm.<br>A) O(n)<br>B)
Q59: Can you search the following array using
Q60: Merge sort is a(n) _ algorithm.<br>A) O(n)<br>B)
Q61: The code segment below displays a table