Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2014-07-22 22:52:33
阅读次数:
166
PerformanceNow that we have a basic model for how things are working, let's consider some things that could go wrong that would make it slow. That wil...
分类:
其他好文 时间:
2014-07-22 22:51:16
阅读次数:
258
找程式砍 .DS_Store 很烦,直接让它不要出现吧 其实这问题困扰我很久了,每个目录裡面都会跑出一个 .DS_Store 的档案,我通常都是用 ? find /path/to -name 『.DS_Store』 -delete ? 来砍,不过砍了又会自动再生...
分类:
其他好文 时间:
2014-07-22 09:03:07
阅读次数:
198
What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use constant extra space.For example,Given ...
分类:
其他好文 时间:
2014-07-22 08:37:34
阅读次数:
289
1、Oracle8/8i/9i数据库(thin模式) Class.forName(“oracle.jdbc.driver.OracleDriver”).newInstance(); String url=”jdbc:oracle:thin:@localhost :1521:orcl”; //orcl为数据库的SID String user=”test”;...
分类:
数据库 时间:
2014-07-21 10:37:04
阅读次数:
291
what's xxxk-means clustering tends to find clusters of comparable spatial extent, while the expectation-maximization mechanism allows clusters to have...
分类:
其他好文 时间:
2014-07-20 09:17:04
阅读次数:
227
start_kernel
rest_init();
kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
do_basic_setup();
driver_init();
void __init driver_init(void)
void __init driver_init(vo...
分类:
其他好文 时间:
2014-07-20 00:10:38
阅读次数:
318
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?...
分类:
编程语言 时间:
2014-07-19 23:46:49
阅读次数:
516
并查集(Union-find Sets)是一种非常精巧而实用的数据结构,它主要用于处理一些不相交集合的合并问题。一些常见的用途有求连通子图、求最小生成树的 Kruskal 算法和求最近公共祖先(Least Common Ancestors, LCA)等。
使用并查集时,首先会存在一组不相交的动态集合 S={S1,S2,?,Sk},一般都会使用一个整数表示集合中的一个元素。
每个集合可能包含一个...
分类:
其他好文 时间:
2014-07-19 23:23:29
阅读次数:
378
Floyd可解。
求最短的,能来回的路。用Floyd 并且在 三点不相同的时候 把最短找出来。然后更新。
开始没有判断!=INF。结果溢出一堆负数。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x7...
分类:
其他好文 时间:
2014-07-19 18:13:20
阅读次数:
245