题解
AVL树的插入,然后判断一下是否为完全二叉树。
题目简单,然而考试的时候没做出来= =
好久没写过平衡树,记不得了,只写了个普通的BST得了可怜的6分。。
基础不牢啊。。务实基础!!!
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <string>
#include <set>
using namespace std;
const int maxn = 30;
typedef struct Node* AVLTree;
struct Node{
int key;
Node* left;
Node* right;
int height;
Node(int k):key(k), left(NULL), right(NULL), height(