FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
algorithm/Week_01/id_129/LeetCode_153_129.java at master · feixiangcode/algorithm · GitHub
feixiangcode
/
algorithm
Public
forked from
algorithm001/algorithm
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
algorithm
/
Week_01
/
id_129
/
LeetCode_153_129.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (19 loc) · 546 Bytes
Breadcrumbs
algorithm
/
Week_01
/
id_129
/
LeetCode_153_129.java
Copy path
File metadata and controls
19 lines (19 loc) · 546 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public
class
LeetCode_153_129
{
public
int
findMin
(
int
[]
nums
) {
int
low
=
0
,
mid
;
int
high
=
nums
.
length
-
1
;
if
(
high
==
0
)
return
nums
[
0
];
int
min
=
nums
[
0
];
while
(
low
<=
high
) {
mid
=
low
+ ((
high
-
low
) >>
1
);
if
(
nums
[
low
] <=
nums
[
mid
]) {
min
=
Math
.
min
(
nums
[
low
],
min
);
low
=
mid
+
1
;
}
else
{
min
=
Math
.
min
(
nums
[
mid
],
min
);
high
=
mid
-
1
;
}
}
return
min
;
}
}
Back
|
FazBrowse Home
|
New Git URL