Dsa
Binary Search
Medium
Peak Element Find
You are given an array where every element is distinct and the array is unsorted. A peak element in the array is defined as an element that is greater than its neighbors. Your task is to find any peak element using binary search. Your program should print the peak element if it exists. The input consists of a single line with space-separated integers. Example:
Input:
1 3 20 4 1 0 8
Output:
20
Key concepts
binary_searcharraydivide_and_conquer
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now