Top "Binary-search" questions

Binary search is an efficient algorithm for finding an element in a sorted array.

Binary Search O(log n) algorithm to find duplicate in sequential list?

Does anyone know a faster-than-linear algorithm for finding a duplicate in a sequential list of numbers? I'm working in Java …

java algorithm binary-search
Where to choose linear search over binary search

After having searched the internet I was not able to satisfy myself that I had found a comprehensive set of …

algorithm search binary-search linear-search
Best algorithm to find the minimum absolute difference between two numbers in an array

There is an array which can contain, say, upto 1000 elements. The range of numbers it can spawn is say 1 to 10^10. …

algorithm perl sorting binary-search
How to implement binary search in JavaScript

https://www.khanacademy.org/computing/computer-science/algorithms/binary-search/p/challenge-binary-search I was following the pseudo code to implement algorithm on …

javascript algorithm binary-search bisection
findInterval() with right-closed intervals

The great findInterval() function in R uses left-closed sub-intervals in its vec argument, as shown in its docs: if i &…

r binary-search
largest sum of contiguous subarray No Larger than k

For example, we have {2,2,-1}, when k = 0, return -1. when k = 3, return 3. This is even tricky because we have negative …

algorithm queue dynamic-programming binary-search kadanes-algorithm