Although the basic idea of binary search is comparatively straightforward, the details can be surprisingly tricky … — Donald Knuth
in the history in Section 6.2.1 of his Sorting and Searching, Knuth points out that while the first binary search was published in 1946, the first published binary search without bugs did not appear untial 1962. – Programming Pearls, Jon Bentley
Problem
Java
1
Copyright © 2000–2019 Robert Sedgewick and Kevin Wayne. All rights reserved.
1 | class Solution { |
Submission Detail
- 46 / 46 test cases passed.
- Runtime: 0 ms, faster than 100.00% of Java online submissions for Binary Search.
- Memory Usage: 40.6 MB, less than 29.73% of Java online submissions for Binary Search.
2
1 | class Solution { |
Submission Detail
- 46 / 46 test cases passed.
- Runtime: 0 ms, faster than 100.00% of Java online submissions for Binary Search.
- Memory Usage: 42.8 MB, less than 5.41% of Java online submissions for Binary Search.