循环有序 一共有以下两种情况 第一种 / / // / / 条件:(A[mid] >= A[low]) ,low~mid 二分,mid~high 递归第二种 / / / / / / 条件:(A[mid] A[mid])12 ...
分类:
其他好文 时间:
2014-06-19 06:46:36
阅读次数:
303
1 #include "iostream" 2 #include "windows.h" 3 #define MAX 0x7fffffff 4 using namespace std; 5 6 void merge(int s,int q,int e,int A[]){ 7 int i,...
分类:
其他好文 时间:
2014-06-18 21:52:18
阅读次数:
234
晚上review了下grunt-inline的issues,看到有个兄弟pull request,修正了0.3.0版本的一个bug。于是就merge了下,然后发布了0.3.1版本(这里)。npm publish后,突然想到一个问题,发布了这么多个版本了,但好像都没有打过tag,这个不利于版本回溯以及...
分类:
其他好文 时间:
2014-06-18 21:33:43
阅读次数:
252
Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
分类:
其他好文 时间:
2014-06-18 20:54:36
阅读次数:
202
如果新提交的分支代码和master有冲突,先checkout到分支merge master,解决冲突,然后再checkout master,merge 分支.(1) git checkout edit_package_page git merge master --no-ff这时候会看到很多CO.....
分类:
其他好文 时间:
2014-06-18 19:49:55
阅读次数:
246
二叉查找树(Binary Search Tree),也称二叉排序树(binary sorted tree),是指一棵空树或者具有下列性质的二叉树:若任意节点的左子树不空,则左子树上所有结点的值均小于它的根结点的值任意节点的右子树不空,则右子树上所有结点的值均大于它的根结点的值任意节点的左、右子树也分...
分类:
其他好文 时间:
2014-06-16 23:32:04
阅读次数:
199
没什么太多讲的,可以使用递归和迭代两种方法来做,要仔细考虑各种输入情况。code如下:...
分类:
其他好文 时间:
2014-06-15 15:09:59
阅读次数:
145
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.The first integer of each...
分类:
其他好文 时间:
2014-06-15 14:12:44
阅读次数:
238
Follow up for ”Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted array A = [1,1,1,2,2,3],Your function should...
分类:
其他好文 时间:
2014-06-14 16:08:32
阅读次数:
200
表连接方式及使用场合NESTED LOOP对于被连接的数据子集较小的情况,nested loop连接是个较好的选择。nested loop就是扫描一个表,每读到一条记录,就根据索引去另一个表里面查找,没有索引一般就不会是 nested loops。一般在nested loop中, 驱动表满足条件结果...
分类:
其他好文 时间:
2014-06-14 15:22:15
阅读次数:
218