# Binary search algorithm interview questions

### Ship capacity problem

There are some problems which do not appear to be a binary search problem at first. For example, ship capacity problem on leetcode. Problem statement is: A conveyor belt has ...

### Keep an eye on the binary search algorithm

What is binary search algorithm A classic example of the application of the binary search algorithm is searching for a word in a dictionary, or when you open a page ...

### Number of occurrences of element

Number of occurrences of element Given a sorted array and a key, find the number of occurrences of a key in that array. For example, in the below array, the ...

### Last occurrence element in array

Finding the last occurrence of an element in a list of numbers is very similar to the First occurrence of an element with binary search. Given a sorted array and ...

### First occurrence of element with binary search

First occurrence of element in sorted array Given a sorted array and an element, find the first occurrence of key in array.  As array can contain duplicate values, there can ...

### Minimum number of pages to read

In a previous post Ceiling in a sorted array using binary search, we understood a very important concept about the application of binary search in problems where minimum or maximum of ...

### Ceiling in sorted array using binary search

Ceiling in sorted array In last post, binary search algorithm, we discussed basics of algorithm, it's implementation and worst case complexity. Today, we will use binary search algorithm to solve another ...

### Binary search algorithm

Binary search algorithm The binary search algorithm is a very known algorithm and taught in the basics of computer science algorithm class. It is simple algorithm however, it is very ...

### Longest Increasing Subsequence in O(nlogn)

In the last post, longest increasing subsequence, we discussed brute force and dynamic programming based solutions. The complexity of the brute force solution is exponential whereas for the dynamic programming ...