/** * Definition for binary tree * struct
TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) :
val(x), left(...
分类:
其他好文 时间:
2014-07-22 23:07:34
阅读次数:
312
Given a binary tree, find its maximum depth.The
maximum depth is the number of nodes along the longest path from the root node
down to the farthest le...
分类:
其他好文 时间:
2014-07-22 23:07:13
阅读次数:
379
Definition: see
wikihttp://en.wikipedia.org/wiki/Binary_search_tree 1 /* 2 This look up is a
fast operation because you eliminate the half 3 t...
分类:
其他好文 时间:
2014-07-22 23:06:34
阅读次数:
330
题意:给n,m,k;输出n经过+-*%后(n%k+k)%k==((n+1)%k)%k
输出最小路径与运算副zsd:% 只是求余数 有正负 mod 是求模 无正负、yhd:对m*k求余对 对k求余不对#include#includeusing
namespace std;struct Node{ .....
分类:
其他好文 时间:
2014-07-22 23:06:14
阅读次数:
369
>原文标题:Node.js Module – exports vs
module.exports
原文链接:[http://www.hacksparrow.com/node-js-exports-vs-module-exports.html](http://www.hacksparrow.co...
分类:
Web程序 时间:
2014-05-01 15:25:33
阅读次数:
452
Given a binary tree, determine if it is
height-balanced.For this problem, a height-balanced binary tree is defined as a
binary tree in which the depth...
分类:
其他好文 时间:
2014-05-01 14:38:39
阅读次数:
454
一种动态样式语言.LESS 将 CSS 赋予了动态语言的特性,如变量,继承,运算,函数.
LESS 既可以在客户端上运行 (支持IE 6+, Webkit, Firefox),也可以借助Node.js或者Rhino在服务端运行。变量简单示例: //
LESS@color: #4D926F;#hea....
分类:
其他好文 时间:
2014-05-01 14:25:11
阅读次数:
350
安装node.js从http://nodejs.org/
下载安装程序进行安装。安装后从开始菜单启动:Node.js command
prompt安装web开发框架Express如果需要代理访问网络,先用下面的命令设置代理:> npm config set
proxy=http://192.168....
分类:
Web程序 时间:
2014-05-01 01:48:43
阅读次数:
375
伸展树模版真的好长好长。。。
cut a b c:把第a-1个数伸展到根节点,把第b+1个数伸展到a的右子树,然后把ch[ch[root][1][0]]拿掉,放在剩下的树的第c个节点下。
flip a b:把第a-1个数伸展到根节点,把第b+1个数伸展到a的右子树,然后翻转ch[ch[root][1][0]];
由于会出现操作两边的情况,所以加了两个-1节点。
注意:
1,输出的时候要注...
分类:
其他好文 时间:
2014-04-27 22:31:19
阅读次数:
295
在Linux内核中,hlist(哈希链表)使用非常广泛。本文将对其数据结构和核心函数进行分析。
和hlist相关的数据结构有两个:hlist_head 和 hlist_node
//hash桶的头结点
struct hlist_head {
struct hlist_node *first;//指向每一个hash桶的第一个结点的指针
};
//hash桶的普通结点
struct hl...
分类:
系统相关 时间:
2014-04-27 21:24:06
阅读次数:
579