Multiple Choice
What must be true about the return value from the implementation of the compare method for the Comparator interface when comparing two objects, a and b with a call to compare(a, 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 a negative value if a comes before b, 0 if they are the same, and a positive value 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 -1 if a comes before b, 0 if they are the same, and 1 if a comes after b.
Correct Answer:

Verified
Correct Answer:
Verified
Q9: Assume we are using quicksort to sort
Q10: Consider the minimumPosition method from the SelectionSorter
Q11: Consider the following code snippet: <img src="https://d2lvgg3v3hfg70.cloudfront.net/TB7392/.jpg"
Q12: The code segment below displays a pattern
Q13: Assume that names is an array of
Q15: In big-Oh notation, suppose an algorithm requires
Q16: Which sort algorithm starts by partitioning the
Q17: How many comparisons does selection sort make
Q18: The largestPosition method below returns the index
Q19: Which of the following statements about running