Top interview questions on Binary search to get hands on ~
Title |
Article(Editorial ) Link |
Practice Link |
---|---|---|
Lower and Upper Bound |
Solve |
|
Search Insert Position |
Solve |
|
Sqrt(x) |
Solve |
|
First and Last occurrence of a number |
Solve |
|
Search in sorted rotated array |
Solve |
|
Search in sorted rotated array II |
Solve |
|
Min element in sorted rotated array |
Solve |
|
Find peak element in a mountain array |
Solve |
|
Koko Eating Bananas |
Solve |
|
Allocate Books |
Solve |
|
Aggressive Cows |
Solve |
|
Minimize max distance to gas station |
Solve |
|
Capacity to ship packages within D days |
Solve |
|
Median of 2 sorted arrays |
Solve |
|
Nth root of a number |
Solve |
|
Kth element of 2 sorted arrays |
Solve |
|
Find Peak element II |
||
Find Median in row wise sorted array |
Solve |
|
Search in row wise and column wise sorted array |
Solve |
Most Asked Binary Search Interview Questions
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 an ordered list of data based on the Divide and Conquer technique which repeatedly halves the search space in every iterationConditions for when to apply Binary Search in a Data Structure:
To apply the Binary Search algorithm:
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.
Check out this article on how to Identify and Solve Binary search Problems – View