Multiple choice technology programming languages

For Arrays & Collection, Sort order & search order need not to be SAME.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

For binary search methods (like Arrays.binarySearch or Collections.binarySearch) to work correctly, the array or collection must be sorted in the same natural order that the search expects. If the sort order differs from the search order, results are unpredictable. Therefore, the sort and search order MUST be the same.