abc_begin

导航

2017年9月18日 #

159. Find Minimum in Rotated Sorted Array 【medium】

摘要: 159. Find Minimum in Rotated Sorted Array 【medium】 Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 mig 阅读全文

posted @ 2017-09-18 17:05 LastBattle 阅读(104) 评论(0) 推荐(0)

14. First Position of Target 【easy】

摘要: 14. First Position of Target 【easy】 For a given sorted array (ascending order) and a targetnumber, find the first index of this number in O(log n) tim 阅读全文

posted @ 2017-09-18 16:45 LastBattle 阅读(259) 评论(0) 推荐(0)

28. Search a 2D Matrix 【easy】

摘要: 28. Search a 2D Matrix 【easy】 Write an efficient algorithm that searches for a value in an mx n matrix. This matrix has the following properties: Inte 阅读全文

posted @ 2017-09-18 16:20 LastBattle 阅读(248) 评论(0) 推荐(0)

60. Search Insert Position 【easy】

摘要: 60. Search Insert Position 【easy】 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it 阅读全文

posted @ 2017-09-18 15:57 LastBattle 阅读(160) 评论(0) 推荐(0)

141. Sqrt(x) 【easy】

摘要: 141. Sqrt(x) 【easy】 Implement int sqrt(int x). Compute and return the square root of x. Example sqrt(3) = 1 sqrt(4) = 2 sqrt(5) = 2 sqrt(10) = 3 Chall 阅读全文

posted @ 2017-09-18 15:37 LastBattle 阅读(147) 评论(0) 推荐(0)

nginx源码学习_数据结构(ngx_str_t)

摘要: nginx中关于字符串的数据结构位于src/core/ngx_string.c和src/core/ngx_string.h中 先来看一下数据结构: data指针指向字符串起始地址,len表示字符串的有效长度。这里面的data并不保证以'\0'结尾,所以必须配合len去使用,否则极其容易造成缓冲区溢出 阅读全文

posted @ 2017-09-18 15:13 LastBattle 阅读(1234) 评论(0) 推荐(0)

nginx源码学习_数据结构(ngx_int_t)

摘要: nginx中关于整型的数据结构位于src/core/ngx_config.h中 结构比较简单,就是一个typedef的操作,具体如下: 里面的intptr_t和uintptr_t的定义位于/usr/include/stdint.h中 另外,C99 标准定义了 intptr_t 和 uintptr_t 阅读全文

posted @ 2017-09-18 11:45 LastBattle 阅读(811) 评论(0) 推荐(0)

2017年9月17日 #

661. Image Smoother【easy】

摘要: 661. Image Smoother【easy】 Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of 阅读全文

posted @ 2017-09-17 23:31 LastBattle 阅读(290) 评论(0) 推荐(0)

27. Remove Element【easy】

摘要: 27. Remove Element【easy】 Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra spac 阅读全文

posted @ 2017-09-17 22:47 LastBattle 阅读(257) 评论(0) 推荐(0)

26. Remove Duplicates from Sorted Array【easy】

摘要: 26. Remove Duplicates from Sorted Array【easy】 Given a sorted array, remove the duplicates in place such that each element appear only once and return 阅读全文

posted @ 2017-09-17 22:31 LastBattle 阅读(144) 评论(0) 推荐(0)