26 lines
403 B
C++
26 lines
403 B
C++
#include <iostream>
|
|
#include <sstream>
|
|
#include <string>
|
|
|
|
#pragma once
|
|
|
|
class AvlNode {
|
|
public:
|
|
int key;
|
|
AvlNode *left;
|
|
AvlNode *right;
|
|
int height;
|
|
|
|
AvlNode(int key);
|
|
|
|
int max(int n1, int n2);
|
|
int getHeightDifference();
|
|
int getHeight();
|
|
|
|
AvlNode *insert(int key);
|
|
AvlNode *leftRotation();
|
|
AvlNode *rightRotation();
|
|
AvlNode *deleteItem(int key);
|
|
std::string printPreorder();
|
|
};
|