1Z0-804 · Question #29
1Z0-804 Question #29: Real Exam Question with Answer & Explanation
The correct answer is D. 2. public static <T> int binarySearch(List<? extends Comparable<? super T>> list, T key) Searches the specified list for the specified object using the binary search algorithm. The list must be sorted into ascending order according to the natural ordering of its elements (as by the
Question
Exhibit
Options
- A4
- B1
- C3
- D2
- E2
Explanation
public static <T> int binarySearch(List<? extends Comparable<? super T>> list, T key) Searches the specified list for the specified object using the binary search algorithm. The list must be sorted into ascending order according to the natural ordering of its elements (as by the sort(List) method) prior to making this call. If it is not sorted, the results are undefined. list - the list to be searched. key - the key to be searched for. the index of the search key, if it is contained in the list; otherwise, (-(insertion point) - 1).
Community Discussion
No community discussion yet for this question.
