![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二叉树
文章平均质量分 79
元素不会背元素周期表
U don't have to say I love U to say I love you.
展开
-
重建二叉树 Binary Tree Traversals HDU - 1710
利用先序遍历和中序遍历求出后序遍历知识点补充:distance是一个函数模板,返回两个迭代器之间的距离in.begin()相当于数组中的[0],所以返回的距离m,相当于数组中的下标A binary tree is a finite set of vertices that is either empty or consists of a root r and two原创 2017-10-18 20:26:47 · 195 阅读 · 0 评论 -
二叉树遍历模板
遍历定义二叉树结构体的两种方式:第一种:struct node{ int val; node *left; node *right; node():left(NULL),right(NULL) {}};在建立新节点的时候,用以下方式:(红色字体)node *build(node *p,int v){ if(p=原创 2017-10-18 20:06:20 · 270 阅读 · 0 评论 -
Trees on the level HDU - 1622 二叉树
Trees are fundamental in many branches of computer science. Current state-of-the art parallel computers such as Thinking Machines' CM-5 are based on fat trees. Quad- and octal-trees are fundamental to原创 2017-10-18 19:59:13 · 210 阅读 · 0 评论 -
The Falling Leaves UVA - 699 二叉树 深搜
Each year, fall in the North Central region is accompanied by the brilliant colors of the leaves on thetrees, followed quickly by the falling leaves accumulating under the trees. If the same thing h原创 2017-10-19 13:47:22 · 176 阅读 · 0 评论 -
二叉搜索树 HDU - 3791
判断两序列是否为同一二叉搜索树序列Input开始一个数n,(1接下去一行是一个序列,序列长度小于10,包含(0~9)的数字,没有重复数字,根据这个序列可以构造出一颗二叉搜索树。 接下去的n行有n个序列,每个序列格式跟第一个序列一样,请判断这两个序列是否能组成同一颗二叉搜索树。Output如果序列相同则输出YES,否则输出NO Sample Input256743原创 2017-10-20 19:56:44 · 160 阅读 · 0 评论 -
Elven Postman HDU - 5444
Elves are very peculiar creatures. As we all know, they can live for a very long time and their magical prowess are not something to be taken lightly. Also, they live on trees. However, there is somet原创 2017-08-09 16:11:50 · 225 阅读 · 0 评论