ACM__二叉树
二叉树
P1n9
这个作者很懒,什么都没留下…
展开
-
poj2499(逆向找根,用迭代相除法来优化)
POJ-2499 Binary Tree Time Limit: 1000 ms / Memory Limit: 65536 kb Description Background Binary trees are a common data structure in computer science. In this problem we will look at an infinite ...原创 2018-04-23 16:41:49 · 282 阅读 · 0 评论 -
Codeforces Round #505 D - Recovering BST
地址:http://codeforces.com/contest/1025/problem/D 听说是dp,但是爆搜也可以过,但是空间容易爆,用bool存储搜索的状态,会爆空间,所以用bitset,二进制位存储 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int inf = 0x3...原创 2018-08-30 20:13:08 · 119 阅读 · 0 评论 -
pat 1020 Tree Traversals已知后序和中序求层序遍历(二叉树)
地址:https://pintia.cn/problem-sets/994805342720868352/problems/994805485033603072 好久没写二叉树遍历的相关东西,差点忘掉怎么写,特地记录一下: 重建二叉树的函数分别用两种方法实现了一下 详见代码: #include<bits/stdc++.h> using namespace std; typedef lo...原创 2019-02-13 14:53:02 · 216 阅读 · 0 评论