Top "Binary-search" questions

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

Where can I get a "useful" C++ binary search algorithm?

I need a binary search algorithm that is compatible with the C++ STL containers, something like std::binary_search in …

c++ algorithm stl binary-search
Time complexity of binary search for an unsorted array

I am stuck up with two time complexities. To do a binary search with sorted array is O(logN). So …

arrays sorting binary-search
Find local minima in an array

Given an array of integers, find the local minima. An element A[i] is defined as a local minimum if …

arrays algorithm binary-search
Where is binary search used in practice?

Every programmer is taught that binary search is a good, fast way to search an ordered list of data. There …

algorithm binary-search
Finding multiple entries with binary search

I use standard binary search to quickly return a single object in a sorted list (with respect to a sortable …

algorithm binary-search
Implementation of C lower_bound

Based on the following definition found here Returns an iterator pointing to the first element in the sorted range [first,…

c algorithm binary-search lower-bound
Calculating mid in binary search

I was reading an algorithms book which had the following algorithm for binary search: public class BinSearch { static int search ( …

algorithm binary-search
Why is Binary Search a divide and conquer algorithm?

I was asked if a Binary Search is a divide and conquer algorithm at an exam. My answer was yes, …

algorithm data-structures computer-science binary-search divide-and-conquer
Searching for an element in a circular sorted array

We want to search for a given element in a circular sorted array in complexity not greater than O(log …

algorithm binary-search circular-buffer
Faster than binary search for ordered list

is there an algorithm that is faster than binary search, for searching in sorted values of array? in my case, …

c++ arrays algorithm search binary-search