摘要:
点击查看题目 **7-9 完全二叉树的层序遍历 (25 分)** 一个二叉树,如果每一个层的结点数都达到最大值,则这个二叉树就是完美二叉树。对于深度为 D 的,有 N 个结点的二叉树,若其结点对应于相同深度完美二叉树的层序遍历的前 N 个结点,这样的树就是完全二叉树。 给定一棵完全二叉树的后序遍历, 阅读全文
摘要:
#include <bits/stdc++.h> using namespace std; int pre[30005]; int root[35500]; int find(int a) { if(pre[a]!=a) { return find(pre[a]); } else return pr 阅读全文