Finding a Peak

Learn how to find the peak of a sequence through binary search.

We'll cover the following


An element of a sequence is called a peak if it’s greater than all its neighbors. Below, we highlight all peaks of a sequence. Note that the rightmost element is a peak since it’s larger than its single neighbor.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.