Skip to content

Glossary: Data Structures and Algorithms in Java

Arrays.binarySearch

Also written: Collections.binarySearch

Java's built-in binary search on a sorted array (or a sorted list for `Collections`). It returns the index if found, or -(insertion point) - 1 if not.

Where the book teaches it

Related terms

binary searchinsertion point