| Author |
binarySearch() : Help Needed
|
Sandeep Vaid
Ranch Hand
Joined: Feb 27, 2006
Posts: 390
|
|
At page 557 : If the collection/array you want to search was sorted using a Comparator, it must be searched using the same Comparator, which is passed as the second argument to the binarySearch() method. Remember that Comparators cannot be used when searching arrays of primitives. Is comparator 2nd or 3rd argument to binarySearch() ?
|
 |
Allan Jacobs
Greenhorn
Joined: Aug 28, 2006
Posts: 15
|
|
Third argument. Simple API questions are answerable using the Javadoc for the Java API at http://java.sun.com/j2se/1.5.0/docs/api/. The signature for the binarySearch that takes a comparator is: static <T> int binarySearch(T[] a, T key, Comparator<? super T> c)
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: binarySearch() : Help Needed
|
|
|