Concept
What are the requirements for using binary search in Java?
ComputerScienceOne / Searching
"The Arrays and Collections classes provide many variations on methods that implement binary search. All of these methods assume that the array or List being searched are sorted appropriately (you cannot use binary search on a Set as it is an unordered collection). The Arrays class provides several binarySearch() methods, one for each primitive type as well as variations that allow you to search within a specified range of elements. The most generally useful version is as follows:"
Related Ideas
- How does Java perform binary searches on arrays and lists?ComputerScienceOne · Sorted Collections
- How does binary search work with arrays and lists?ComputerScienceOne · Sorting
- What is the general searching problem?ComputerScienceOne · Searching
- Where is Section 12.1.3, Analysis, located?ComputerScienceOne · Binary Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- How do the Arrays and Collections classes sort elements?ComputerScienceOne · Sorting