【题目】
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After removing the second node from the end, the linked list becomes 1->2->3->5.
Note:
Given n will ...
分类:
其他好文 时间:
2014-05-18 18:48:03
阅读次数:
269
分析:暴力要超时,所以把每个数字转换为长度为32的0-1字符串,用字典树。因为其公共前缀的特性,空间上可以承受。因为是二叉树,用node[SIZE][2]存放。不知道new速度是否会慢很多,所以没用指针。...
分类:
其他好文 时间:
2014-05-18 18:37:37
阅读次数:
218
python创建二叉树,源代码如下:
#!/usr/bin/python
class node():
def __init__(self,k=None,l=None,r=None):
self.key=k;
self.left=l;
self.right=r;
def create(root):
a=raw_input('enter a key:');
if a is '#...
分类:
编程语言 时间:
2014-05-18 09:27:13
阅读次数:
384
好多人都是为了找实习、找工作,看看思路,手写下这个问题的代码。如果有机会还是最好真正调试一下,还是有很多细节需要注意的。不多说了,代码记录如下:
Node* Merge(Node *h1,Node *h2)
{
Node *head,*pCurrent,*head1,*head2;
head1 = h1;
head2 = h2;
if(head1==NULL)
retu...
分类:
其他好文 时间:
2014-05-18 02:59:29
阅读次数:
214
目录[-]必备软件:环境配置:【open-jdk-6.0】 【android-sdk】
【ant】 【github】【node.js】 【rvm】(ruby-1.9.3 rails-4.0.0 gemfile)
必备概念:关于自动化部署我推荐大家参谋一下Fortune Zhang的一篇文章:andr...
分类:
移动开发 时间:
2014-05-17 23:17:03
阅读次数:
647
线段树中对一段区间操作的方法----记录增量。详细实现见代码。还要好好体会! 1 //Accepted
6688K 1485MS 2 #include 3 #include 4 #define imax 100005 5 struct node 6 { 7 int
l...
分类:
其他好文 时间:
2014-05-17 21:18:35
阅读次数:
312
1 //Accepted 2384K 1766MS 2 #include 3 #include
4 #define imax 50005 5 struct node 6 { 7 int l,r; 8 int tmax,tmin; 9
}f[3*imax];10 in...
分类:
其他好文 时间:
2014-05-17 21:16:33
阅读次数:
281
1 //Accepted 250MS 2480K 2 #include 3 #include 4
const int MAXN = 50005; 5 struct node 6 { 7 int l,r; 8 int add,sum; 9
}f[3*MAXN];10 int n;...
分类:
其他好文 时间:
2014-05-17 20:36:37
阅读次数:
316
最近正在学习Node,在图书馆借了基本关于Node的书,同时在网上查阅资料,颇有收获,但是整体感觉对Node的理解还是停留在一个很模棱两可的状态。比如Node中的模块,平时练习就接触到那么几个,其他的一些模块暂时只会在学习的时候接触到,不常用便就荒废了。正所谓好记心不如烂笔头,多做笔记还是更有利于理...
TCP/IP 是一些协议的合集。四个层次组成:应用层传输层 TCP 可靠传输网间网层 IP
数据包转发网络接口层 最基础的硬件接口和协议ARP,RARP试用 traceroute和mtr命令。
分类:
其他好文 时间:
2014-05-17 19:12:20
阅读次数:
235