题目:二叉排序树,统计最后两层节点个数 思路:数组格式存储,insert建树,dfs遍历 #include<cstdio> #include<iostream> #include<cstring> #include<algorithm> using namespace std; typedef long long LL; const int INF = 0x7FFFFFFF; const int maxn = 1e5 + 10; int n, cnt[max…
The order of a Tree Problem Description The shape of a binary search tree is greatly related to the order of keys we insert. To be precisely:1. insert a key k to a empty tree, then the tree become a tree with only one node;2. insert a key k to a no…