【实现一个静态资源管理模块】/** *static_module.js */var BASE_DIR = __dirname, //绝对路径 CONF = BASE_DIR + '/conf/', //conf文件的路径 STATIC = BASE_DIR + '/stat...
分类:
Web程序 时间:
2014-10-06 18:31:10
阅读次数:
272
//树的存储结构//双亲存储结构typedef struct{ int data;//结点的值 int parent;//指向双亲位置的伪指针} PTree[maxsize];//孩子存储结构typedef struct node{ int data;//结点的值 struct node *sons...
分类:
其他好文 时间:
2014-10-06 17:07:30
阅读次数:
190
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 leaf node.
/**
* Definition for binary tree
...
分类:
其他好文 时间:
2014-10-06 16:08:40
阅读次数:
181
[leetcode]Populating Next Right Pointers in Each Node...
分类:
其他好文 时间:
2014-10-06 12:54:40
阅读次数:
183
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant extr...
分类:
其他好文 时间:
2014-10-06 00:41:19
阅读次数:
271
题目链接:http://acdream.info/problem?pid=1197题意:给出一些点。每次给出一个长方体,问在长方体中的点的个数。思路:kd-tree。const int N=111111;struct node{ int x[3]; int L,R;};node a[N];int r...
分类:
其他好文 时间:
2014-10-06 00:02:19
阅读次数:
247
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2014-10-05 23:13:59
阅读次数:
166
struct Node{
int index;
int value;
};
bool compare(Node a, Node b)
{
return a.value < b.value;
}
class Solution {
public:
vector twoSum(vector &numbers, int target) {
...
分类:
其他好文 时间:
2014-10-05 22:56:39
阅读次数:
252
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 leaf node.
点击打开原题链接
这个题剑指offer里也有,简单的递归即可,代码很清晰:...
分类:
其他好文 时间:
2014-10-05 22:56:09
阅读次数:
185
填充所有的结点如果存在右侧的节点,则指上(next)右节点;如果没有右侧的节点,那么就指上NULL,最初都指上NULL。
提示:只能使用给定的空间,并且你可以认为给定的二叉树是一个完美的二叉树。...
分类:
其他好文 时间:
2014-10-05 21:52:19
阅读次数:
145