File tree Expand file tree Collapse file tree 2 files changed +56
-1
lines changed
_includes/_root/find-minimum-in-rotated-sorted-array
find-minimum-in-rotated-sorted-array Expand file tree Collapse file tree 2 files changed +56
-1
lines changed Original file line number Diff line number Diff line change
1
+ ## Variant of [ Search in Rotated Sorted Array] ( ../search-in-rotated-sorted-array )
2
+
3
+
4
+ ### The 3 cases in a ` Rotated Sorted Array ` when using binary search
5
+
6
+ * ` s ` < ` m ` < ` e ` : ` min = num[s] `
7
+
8
+
9
+
10
+ ```
11
+ 1 E
12
+ 2 *
13
+ 3 *
14
+ 4 *
15
+ 5 *
16
+ 6 M
17
+ 7 *
18
+ 8 *
19
+ 9 *
20
+ 10 S
21
+ ```
22
+
23
+ * ` s ` < ` m ` > ` e ` : min must in ` m .. e `
24
+
25
+
26
+ ```
27
+ 1 *
28
+ 2 *
29
+ 3 M
30
+ 4 *
31
+ 5 *
32
+ 6 *
33
+ 7 S
34
+ 8 E
35
+ 9 *
36
+ 10 *
37
+ ```
38
+
39
+ * ` s ` > ` m ` < ` e ` min must in ` s .. m + 1 `
40
+
41
+
42
+ ```
43
+ 1 *
44
+ 2 *
45
+ 3 S
46
+ 4 E
47
+ 5 *
48
+ 6 *
49
+ 7 *
50
+ 8 M
51
+ 9 *
52
+ 10 *
53
+ ```
54
+
55
+ Now, Loop until ` s ` < ` m ` < ` e `
Original file line number Diff line number Diff line change 1
1
---
2
2
layout : solution
3
3
title : Find Minimum in Rotated Sorted Array
4
- date : 2014-10-16 11:40:27+08:00
4
+ date : 2014-10-16 11:56:32 +0800
5
5
---
6
6
{% assign leetcode_name = {{page.path | remove: '/index.md'}} %}
7
7
{% assign leetcode_readme = {{leetcode_name | append: '/README.md' | prepend: '_ root/' }} %}
You can’t perform that action at this time.
0 commit comments