Sort a linked list inO(nlogn) time using constant space complexity.思路:采用归并排序或者快速排序#include using namespace std;struct ListNode { int val; ListNo...
分类:
其他好文 时间:
2014-09-20 20:12:09
阅读次数:
230
首先求出所有的单间两两是否接触如果接触,说明他们之间的边长为0,不接触那么就是圆心的距离减去两个单间的半径。然后构图求最小生成树,采用Kruskal算法。...
分类:
其他好文 时间:
2014-09-19 23:57:56
阅读次数:
480
连续的英文或数字能是容器被撑大,不能根据容器的大小自动换行,对于Div和table以及不同的浏览器,实现css自动换行的方法都稍有不同,下面分别介绍: 对于div 1.(IE浏览器)white-space:normal; word-break:break-all;这里前者是遵循标准。以下是引用片段....
分类:
其他好文 时间:
2014-09-19 13:35:15
阅读次数:
211
AIX weblogic 启动报There is not enough buffer space for the requested socket operation 错误 ???? <Sep 19, 2014 10:27:09 AM GMT+08:00> <Error> <Coherence> <BEA-000000> <Oracle Coherence 3.6.0.4 ...
分类:
Web程序 时间:
2014-09-19 12:19:05
阅读次数:
305
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:
其他好文 时间:
2014-09-19 01:06:54
阅读次数:
301
Peter had a cube with non-zero length of a side. He put the cube into three-dimensional space in such a way that its vertices lay at integer points (it is possible that the cube's sides are not parall...
分类:
其他好文 时间:
2014-09-18 16:36:44
阅读次数:
196
简介sed 是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容并没有 改变,除非你使用重定向存储输...
分类:
其他好文 时间:
2014-09-18 11:21:23
阅读次数:
292
linuxsed删除空行和空格符命令sed/^$/dfilename可以删除文件中的空行。sed/^[[:space:]]*$/dfilename可以删除内容为多个空格/tab组成的行。sed‘s/\//g‘$1可以删除行中的空格
分类:
系统相关 时间:
2014-09-18 09:53:44
阅读次数:
229
Sort a linked list in O(n log n) time using constant space complexity.记得Insert Sort List, 那个复杂度是O(N^2)的,这里要求O(nlogn),所以想到merge sort, 需要用到Merge Two Sor...
分类:
其他好文 时间:
2014-09-18 01:57:43
阅读次数:
199
18gg 跳到指定行号gg 第一行G 最后一行M 这一页中间H 这一页第一行ctrl + g当前行号5 + enter 跳到下面5行5 + space 跳到后面5个字符处dd删除这一行5dd删除5行查找用 /find 或者?find 然后enter find是要找的词用n或者N找下一个匹配到的...
分类:
其他好文 时间:
2014-09-18 00:44:32
阅读次数:
176