今天更新时候出现了点小问题,一开始更新到一半,我嫌速度慢,就取消掉了。更新了sources.list之后再执行sudo apt-get update 提示我出错了E: Could not get lock /var/lib/apt/lists/lock - open (11 Resource tem...
分类:
其他好文 时间:
2015-03-15 21:11:39
阅读次数:
227
Git是什么? distributed version control system 分布式版本控制系统Git与SVN区别 SVN是集中是管理,只需要commit即可 Git 是分布式(每个人电脑里都有完整的版本库),需要manual merge 手动合并,因此需要code review但是呢...
分类:
其他好文 时间:
2015-03-15 19:34:05
阅读次数:
114
首先是归并排序,基本思想为分治,合并的技巧比较重要,不是原址排序。代码如下;int merge(int* x,int left,int mid,int right)
{
int i,j,k;
int L1 = mid-left+2;
int L2 = right-mid+1;
int* L = new int[L1];
int* R = new int[L2]...
分类:
编程语言 时间:
2015-03-15 15:24:06
阅读次数:
184
1.两个有序数组组合成一个新的有序数组<?php$arr1=array(2,5,7,9,12);$arr2=array(3,4,6,8,10,11);function merge_sort($arr1,$arr2){ $len1=count($arr1); $len2=count($ar...
分类:
编程语言 时间:
2015-03-15 10:46:14
阅读次数:
217
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 link...
分类:
其他好文 时间:
2015-03-15 07:06:35
阅读次数:
100
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].
题意:去掉重复的区间。
思路:排序后,再比较end的情况。
/**
* Definition fo...
分类:
其他好文 时间:
2015-03-15 00:52:06
阅读次数:
132
题目链接:Merge Intervals
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].
这道题的要求是将给定的一组间隔中有重叠的进行合并。
...
分类:
其他好文 时间:
2015-03-14 23:14:37
阅读次数:
182
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Examp...
分类:
其他好文 时间:
2015-03-14 23:12:09
阅读次数:
217
{pc:content action="lists" catid="$catid" num="25" order="id DESC" page="$page" moreinfo="1"}{loop $data $r}{date('Y-m-d H:i:s',$r[inputtime])}·{$r[ti...
分类:
Web程序 时间:
2015-03-14 18:20:49
阅读次数:
151
两个指针的做法,但比起2个数组有序的数组的话,链表做更容易,因为当一个链表遍历结束后,tail指针并不需要遍历另一个链表,只要直接指向它就行/** * Definition for singly-linked list. * struct ListNode { * int val; * ...
分类:
其他好文 时间:
2015-03-13 22:04:13
阅读次数:
147