NerdTreeThe NERD tree allows you to explore your filesystem and to open files anddirectories. It presents the filesystem to you in the form of a tree ...
分类:
其他好文 时间:
2014-07-09 16:24:53
阅读次数:
193
二叉排序树(Binary Sort Tree):或者是一颗空树,或者是具有以下性质的树:(1)若它的左子树不空,则左子树上所以结点的值均小于它的根节点的值;(2)若它的右子树不空,则右子树上的所以结点的值均大于它的根节点的值;(3)它的左、右子树也分别是二叉排序树。
二叉排序树的基本操作均可以在O(h)时间内完成(算法导论p165)。
相关操作代码如下:
int InsertBST(BiTr...
分类:
其他好文 时间:
2014-07-09 13:12:09
阅读次数:
160
模板
题意:给你一个图,1总是为根,每个边有单位价值,每个点有权重。
每条边的价值 = sum(后继节点权重)*边的单位价值。
求树的最小价值,即构成一棵树的n-1条边的最小价值。
算法:
1、因为每个边的价值都要乘以后来访问的节点的权重,而走到后来访问的点必经过这条边。
实际上总价值就是 到每个点的最短路径*这个点的权重。
2、但是这个题 数据量真的太大了,50000个点...
分类:
其他好文 时间:
2014-07-09 11:33:57
阅读次数:
273
这个点POJ挂了,代码没法提交,先存到这里,明天再提交试试看。
//#define DEBUG
#include
#define maxn 100002
#define lson l, mid, rt << 1
#define rson mid + 1, r, rt << 1 | 1
__int64 tree[maxn << 2], arr[maxn], lazy[maxn << 2];...
分类:
其他好文 时间:
2014-07-09 09:41:55
阅读次数:
213
题目
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent
a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find ...
分类:
其他好文 时间:
2014-07-08 21:43:08
阅读次数:
219
线段树应用:
有一个数列,初始时为 a1,a2,… aN (N
1) 将 ai 的值加上 val ;
2) 对于一个区间[l,r],该区间的和。
3) 对于一个区间[l,r],求该区间的最大值。
数据结构:
//Node Type
struct Node{
int left, right;
int max, sum;
} tree[maxn];
/*
tree[k]'...
分类:
其他好文 时间:
2014-07-08 21:31:33
阅读次数:
237
http://poj.org/problem?id=2513
最初看到 第一感觉---map 一看250000的数据量 果断放弃
然后记得以前看过,trie代替map,尤其当数据量特别大的时候
学到了:
1、Trie代替map的思想,可以在单词结尾的tree[i][tk] 这个i作为字符串对应的int值 ,当然这个int值也可以用于建立并查集
2、接上,通过并查集判断,所有的点在同一...
分类:
移动开发 时间:
2014-07-08 19:09:11
阅读次数:
204
地形元素
一般情况下,为了使游戏更具有美观性,会在游戏地形上放置很多的元素,这些元素是与地形分开的。主要包括:树木,草地,自定义网格模型。
树元素
首先导入系统提供的树木标准资源包,在project视图中,点击鼠标右键,然后从菜单中选择import-----tree creator。接着在地形菜单里点击第五个按钮,添加树模型。然后点击edit trees按钮,将弹出如下列表:...
分类:
其他好文 时间:
2014-07-08 18:24:33
阅读次数:
266
The Lost House
Time Limit: 3000MS
Memory Limit: 30000K
Total Submissions: 2140
Accepted: 886
Description
One day a snail climbed up to a big tree and finally came to th...
分类:
其他好文 时间:
2014-07-08 18:08:00
阅读次数:
267