Coding · Medium · Pro
Find minimum element in a rotated sorted array (no duplicates)
CodingBinary SearchSenior
Approach
- Compare
nums[mid]withnums[hi]to know which half is sorted. - If
nums[mid] > nums[hi], minimum is in the right half.
Coding · Medium · Pro
nums[mid] with nums[hi] to know which half is sorted.nums[mid] > nums[hi], minimum is in the right half.