LeetCode p153 Find Minimum in Rotated Sorted Array 题解
1.题目:
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).
Find the minimum element.
You may assume no duplicate exists in the array.
题意:
输入一个有序数组,它有可能会从某处折断反转,找出数组中最小的那个数。
2.解题思路:
采用二分。。考虑边界条件。TUT
3.代码
1 |
|