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 ...
分类:
其他好文 时间:
2014-05-16 23:18:16
阅读次数:
360
最近一段时间是决定好好把算法大体学一遍了。今天发现了一个有趣的定理:cayley’s theorem:
过n个有标志顶点的树的数目等于n^(n-2)。以4个nodes的树为例,应该是16个没错,然后找了好半天也没有找到能看懂的证明过程。如果有哪位有发现比较易懂的证法,欢迎和我在留言讨论。:)
分类:
其他好文 时间:
2014-05-13 18:25:06
阅读次数:
183
Given a linked list, reverse the nodes of a
linked listkat a time and return its modified list.If the number of nodes is not
a multiple ofkthen left-o...
分类:
其他好文 时间:
2014-05-11 18:15:52
阅读次数:
300
坑爹地多次过,全都是写程序时不注意的小问题,书写习惯还需要进一步改善。遇到的bug有:忘记return语句;定义ListNode
runner = head.next,却将判断head==null的情况放在这句之后;
忘记了新的head将不会是原来的那个head,而是head.next;所以以后遇到...
分类:
其他好文 时间:
2014-05-10 06:59:37
阅读次数:
320
Problem DescriptionA tree is a well-known data
structure that is either empty (null, void, nothing) or is a set of one or more
nodes connected by dire...
分类:
其他好文 时间:
2014-05-10 03:18:52
阅读次数:
374
题目:
Clone an undirected graph. Each node in the graph contains a label and
a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separat...
分类:
其他好文 时间:
2014-05-09 22:31:35
阅读次数:
353
Clustering
coefficient的定义有两种;全局的和局部的。全局的算法基于triplet。首先解释triplet。triplet 包含 open triplet 和
closed triplet 两种(A triplet is three nodes that are connecte...
分类:
其他好文 时间:
2014-05-09 05:28:02
阅读次数:
280
1、Clone Graph
Clone an undirected graph. Each node in the graph contains a label and
a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as...
分类:
其他好文 时间:
2014-05-09 02:17:58
阅读次数:
336
#viCA.sh看结构:定义两个函数(32-55,57-59*);第二个函数,比较使用啊,可以收藏。第二个函数usage(){echo"usage:$0-newcert|-newreq|-newreq-nodes|-newca|-sign|-verify">&2}最终的效果就是这样(实现见后边);init.d下的脚本常常有,用起来挺好。
分类:
其他好文 时间:
2014-05-08 17:04:29
阅读次数:
253
Given a sorted linked list, delete all nodes
that have duplicate numbers, leaving onlydistinctnumbers from the original
list.For example,Given1->2->3-...
分类:
其他好文 时间:
2014-05-07 13:42:51
阅读次数:
278