Dsa
Binary Search
Medium
Determine Minimum in Rotated Sorted Array
You have a rotated sorted array that contains distinct integers. Write a program to find the minimum element in this array using binary search.
Input Format:
- The first line contains an integer n, the size of the array.
- The second line contains n distinct integers, representing the rotated sorted array.
Output Format:
- Print the minimum element in the array.
Example:
Input:
5
3 4 5 1 2
Output:
1
Key concepts
binary_searcharrays
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