33. Search in Rotated Sorted Array

题意 给一个有序数组,在一个特定的未知位置旋转一次。要求在logn的时间内找到target。 思路 先找到在哪里进行旋转,然后根据范围在左半部分或者右半部分二分查找。 代码 class Solution { public: int jtfind(vector<int>& nums, int t, int left, int right) { if (right <
相关文章
相关标签/搜索