题目:Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it withou...
分类:
其他好文 时间:
2014-07-07 13:44:29
阅读次数:
281
Given a sorted linked list, delete all duplicates such that each element appear only once.
分类:
其他好文 时间:
2014-07-02 00:33:49
阅读次数:
204
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
分类:
其他好文 时间:
2014-07-02 00:24:04
阅读次数:
284
用户控件(.ascx)与以及布局 小结一、用户控件(.ascx)1、aspx是浏览器直接访问的页面,而ascx是用户控件,一般是用来重用。 比如:有2个aspx页面,有一部分代码一样,这里可以提取出来做成用户控件(ascx)就可以重用了。 如果单纯N个aspx页面,就只能复制粘贴,要修改时候就很.....
分类:
其他好文 时间:
2014-07-01 20:47:50
阅读次数:
214
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
分类:
其他好文 时间:
2014-06-30 23:36:56
阅读次数:
211
有n个营地,每个营地至多容纳Ci人,给出m个条件:第i到第j个营地之间至少有k人。
问n个营地总共至少有多少人。
此题显然差分约束,要求最小值,则建立x-y>=z方程组,建图求最长路。
用d[i]表示[1,i]个帐篷中一共多少人,根据题意可得到不等关系:
1、0
2、d[j]-d[i]>=k
此外,我们添加0为附加结点,则0到其他点也要建边。
再求解0为源点的最长路即可。
...
分类:
其他好文 时间:
2014-06-30 19:41:42
阅读次数:
205
题目
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
方法
publi...
分类:
其他好文 时间:
2014-06-30 19:36:33
阅读次数:
163
使用静态链接的方式
#include
#include
#include
#ifdef __cplusplus
extern "C" {
#endif
#include "lua/include/lua.h"
#include "lua/include/lauxlib.h"
#include "lua/include/lualib.h"
#pragma comment (li...
分类:
其他好文 时间:
2014-06-30 18:28:47
阅读次数:
216
题目
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look lik...
分类:
其他好文 时间:
2014-06-30 18:13:31
阅读次数:
229
class Solution {public: ListNode *reverseBetween(ListNode *head, int m, int n) { if (head == NULL || n 0) { pre = cur; ...
分类:
其他好文 时间:
2014-06-30 15:36:26
阅读次数:
148