Mega Code Archive

 
Categories / Java Book / 005 Collection
 

0326 Do binary search

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. static<T> int binarySearch(List<? extends T> list, T key, Comparator<? super T> c) Searches the specified list for the specified object using the binary search algorithm.