就是基础的avl操作
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
typedef struct node {
int val;
int height;
struct node *left;
struct node *right;
}Node,*TreeNode;
TreeNode newnode(int val){
TreeNode node = new Node;
node->val = val;
node->height = 1;
node->left = node->right = NULL;
return node;
}
int getHeight(TreeNode root){
if(!root) return 0;
return root->height;
}
int getBalance(TreeNode root){
return getHeight(root->left) - getHeight(root->right);
}
void updateHeight(TreeNode root){
root->height = max(getHeight(root->left),getHeight(root->right))+1;
}
void L(TreeNode &root){
TreeNode temp = root->right;
root->right = temp->left;
temp->left = root;
updateHeight(root);
upda