树
韩小震
一不小心就入坑了~
展开
-
哈夫曼树+优先队列
F - Fence RepairTime Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionFarmer John wants to repair a small length of the fence around原创 2016-08-16 21:33:17 · 691 阅读 · 0 评论 -
由先序中序求后序
PAT 1086An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is trav原创 2016-08-14 10:59:56 · 353 阅读 · 0 评论 -
国王的烦恼 蓝桥杯(最小生成树 kru)
历届试题 国王的烦恼 时间限制:1.0s 内存限制:256.0MB 问题描述 C国由n个小岛组成,为了方便小岛之间联络,C国在小岛间建立了m座大桥,每座大桥连接两座小岛。两个小岛间可能存在多座桥连接。然而,由于海水冲刷,有一些大桥面临着不能使用的危险。 如果两个小岛间的所有大桥都不能使用,则这两座小岛就不能直接到达了。然而,只要这两座小岛原创 2017-02-18 20:36:51 · 509 阅读 · 0 评论 -
链接三维空间中n个点的最短距离 最小生成树(krukal算法)
DESCRIPTIONSpoon Devil build a 3-D matrix, and he(orshe) wants to know if he builds some bases what's the shortest distance toconnect all of them.INPUTThere are multiple test cases. The firstlin原创 2016-07-23 19:21:28 · 3231 阅读 · 0 评论 -
求链接二维空间中的点 最短的距离 (hdu 1162) kru
Eddy's pictureTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10049 Accepted Submission(s): 5072Problem DescriptionEddy begin原创 2017-02-22 18:47:38 · 1272 阅读 · 0 评论 -
畅通工程 hdu 1232 (并查集)
畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 50387 Accepted Submission(s): 26883Problem Description某省调查城镇交通状况,得到现有城镇道路原创 2017-02-23 14:15:54 · 219 阅读 · 0 评论 -
小希的迷宫 hdu 1272(并查集)
小希的迷宫Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 47105 Accepted Submission(s): 14642Problem Description上次Gardon的迷宫城堡小希玩了很原创 2017-02-23 15:34:52 · 274 阅读 · 0 评论 -
hdu 1856
More is betterTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 26043 Accepted Submission(s): 9341Problem DescriptionMr Wang原创 2017-02-23 17:35:29 · 235 阅读 · 0 评论 -
建树以及遍历
根据先序中序建树#include #include #include #include #define N 50using namespace std;int pre[N],in[N],post[N]; //存放先序,中序,后序的数组 int n;struct Node{ int data; Node* lchild; Node* rchild;};Node原创 2017-03-05 18:04:50 · 522 阅读 · 0 评论