![]() |
VOOZH | about |
Binary search is the most efficient searching algorithm having a run-time complexity of O(log2 N)in a sorted array.
Binary search is a searching technique to search anordered list of data based on the Divide and Conquer technique whichrepeatedly halves the search space in every iterationConditions for when to apply Binary Search in a Data Structure:
:
Whenever we are able to identify that the answer of the problem lies between in a range L to R and there is a Monotonic Behaviour of answer in range L to R then we can think to apply binary search on answer.
- View
Title | Article(Editorial ) Link | Practice Link |
|---|---|---|
Lower and Upper Bound | ||
Search Insert Position | ||
Sqrt(x) | ||
First and Last occurrence of a number | ||
Search in sorted rotated array | ||
Search in sorted rotated array II | ||
Min element in sorted rotated array | ||
Find peak element in a mountain array | ||
Koko Eating Bananas | ||
Allocate Books | ||
Aggressive Cows | ||
Minimize max distance to gas station | ||
Capacity to ship packages within D days | ||
Median of 2 sorted arrays | ||
Nth root of a number | ||
Kth element of 2 sorted arrays | ||
Find Peak element II | ||
Find Median in row wise sorted array | ||
Search in row wise and column wise sorted array |