Skip to content

Commit 00696fe

Browse files
committed
Update 0033. 搜索旋转排序数组.md
1 parent 9083ce3 commit 00696fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Solutions/0033. 搜索旋转排序数组.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
然后创建两个指针 $left$、$right$,分别指向数组首尾。让后计算出两个指针中间值 $mid$。将 $mid$ 与两个指针做比较,并考虑与 $target$ 的关系。
6767

68-
- 如果 $mid[mid] == target$,说明找到了 $target$,直接返回下标。
68+
- 如果 $nums[mid] == target$,说明找到了 $target$,直接返回下标。
6969
- 如果 $nums[mid] \ge nums[left]$,则 $mid$ 在左半部分(因为右半部分值都比 $nums[left]$ 小)。
7070
- 如果 $nums[mid] \ge target$,并且 $target \ge nums[left]$,则 $target$ 在左半部分,并且在 $mid$ 左侧,此时应将 $right$ 左移到 $mid - 1$ 位置。
7171
- 否则如果 $nums[mid] \le target$,则 $target$ 在左半部分,并且在 $mid$ 右侧,此时应将 $left$ 右移到 $mid + 1$ 位置。

0 commit comments

Comments
 (0)