![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分
lyangpku
这个作者很懒,什么都没留下…
展开
-
[LeetCode] Search Insert Position
class Solution { public: int searchInsert(int A[], int n, int target) { // Start typing your C/C++ solution below // DO NOT write int main() function int s = 0; int原创 2013-01-28 04:44:56 · 331 阅读 · 0 评论 -
[LeetCode] Search for a Range
class Solution { public: int find_left(int A[], int s, int t, int target) { int l = s; int r = t; while (l <= r) { int p = (l + r) / 2; if原创 2013-01-28 15:10:16 · 408 阅读 · 0 评论 -
[LeetCode] Sqrt(x)
class Solution { public: int sqrt(int x) { // Start typing your C/C++ solution below // DO NOT write int main() function int s = 0; int t = min(1 << 16, x);原创 2013-01-27 19:50:28 · 367 阅读 · 0 评论 -
[LeetCode] Pow(x, n)
class Solution { public: double pow(double x, int n) { // Start typing your C/C++ solution below // DO NOT write int main() function if (n == 0) return 1; if (n ==原创 2013-01-27 22:43:50 · 328 阅读 · 0 评论 -
[LeetCode] Search in Rotated Sorted Array
class Solution { public: int search(int A[], int s, int t, int target) { int l = s; int r = t; while (l <= r) { int p = (l + r) / 2; if (A[原创 2013-01-28 16:41:27 · 359 阅读 · 0 评论