描述:输出全排列代码: 1 class Solution: 2 # @param num, a list of integer 3 # @return a list of lists of integers 4 def doSth(self, num): 5 ...
分类:
其他好文 时间:
2014-08-11 17:10:32
阅读次数:
205
var alpha = [1, 2, 3, 4, 5, 6], beta = [4, 5, 6, 7, 8, 9];$.arrayIntersect = function(a, b){ return $.merge($.grep(a, function(i) { ...
分类:
Web程序 时间:
2014-08-11 11:42:42
阅读次数:
2321
DSU stands for ‘decorate, sort, undecorate’ and refers to a pattern that is often useful for sorting lists according to some attribute of elements.For...
分类:
其他好文 时间:
2014-08-10 18:03:30
阅读次数:
204
题目:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Outpu...
分类:
其他好文 时间:
2014-08-10 13:08:30
阅读次数:
296
首先,归并排序,分治,递归解决小的范围,再合并两个有序的小范围数组,便得到整个有序的数组。
这是很适合用递归来写的,至于非递归,便是从小到大,各个击破,从而使得整个数组有序。代码如下:
void merge(vector &A, int left, int mid, int right)
{
int i=left,j=mid+1;
vector tmp(right-left+1,0);...
分类:
其他好文 时间:
2014-08-10 13:08:00
阅读次数:
235
简单题:先按左左边排序,然后对输入的区间和当前结果合并 1 /** 2 * Definition for an interval. 3 * struct Interval { 4 * int start; 5 * int end; 6 * Interval() : ...
分类:
其他好文 时间:
2014-08-09 21:25:19
阅读次数:
205
svn常用命令相信大家都非常熟悉,但是merge这个命令很多人却并不常用到,这次由于工作关系,特地学习了一下。由于开发环境是mac,没有像TortoiseSVN这么好用的svn,mac大部分的svn客户端个人觉得都不是特别好用,所以选择用svn命令行。svn merge的思想其实是diff and ...
分类:
其他好文 时间:
2014-08-08 17:27:06
阅读次数:
248
1.聊一聊跳表作者的其人其事
2. 言归正传,跳表简介
3. 跳表数据存储模型
4. 跳表的代码实现分析
5. 论文,代码下载及参考资料
. 聊一聊作者的其人其事
跳表是由William Pugh发明。他在 Communications of the ACM June 1990, 33(6) 668-676 发表了Skip lists: a probabilistic...
分类:
其他好文 时间:
2014-08-08 16:03:46
阅读次数:
189
如图:关键点:1.scroll: 1, //虚拟滚动,解决大数据一次性加载慢的问题,同时解决分页2.function merge(names)//自定义函数$(function () { //查询 $("#querybtn").click(function () { ...
分类:
其他好文 时间:
2014-08-07 21:38:40
阅读次数:
297
Problem Description:
Given a collection of intervals, merge all overlapping intervals.
For example,
Given [1,3],[2,6],[8,10],[15,18],
return [1,6],[8,10],[15,18].
分析:按照要求将区间合并,首先将按照按起点排序,然后...
分类:
其他好文 时间:
2014-08-07 19:05:00
阅读次数:
193