![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
-skyline-
这个作者很懒,什么都没留下…
展开
-
重建二叉树
输入一棵二叉树前序遍历和中序遍历的结果,请重建该二叉树。 注意: 二叉树中每个节点的值都互不相同; 输入的前序遍历和中序遍历一定合法; 样例 给定: 前序遍历是:[3, 9, 20, 15, 7] 中序遍历是:[9, 3, 15, 20, 7] 返回:[3, 9, 20, null, null, 15, 7, null, null, null, null]//注:输出采用二...原创 2019-03-15 21:33:38 · 107 阅读 · 1 评论 -
PTA A1020 Tree Traversals
#include<bits/stdc++.h> using namespace std; const int maxn=45; int in[maxn],post[maxn],Hash[maxn],n;//题目数据范围N<=30, Hash数组不能设成35!!! struct node{ int val; node* left; node* right; node(i...原创 2019-03-16 09:59:13 · 142 阅读 · 0 评论