标签:
1 while (l < r - 1) {
2 int m = l + (r - l) / 2;
3
4 // means that there is no rotate.
5 ... 这里添加各种退出条件,比如找到了目标值等 8
9 // left side is sorted.
10 if (A[m] > A[l]) {
11 l = m;
12 } else {
13 r = m;
14 }
15 }
标签:
原文地址:http://www.cnblogs.com/yuzhangcmu/p/4198907.html