-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAVLTree.h
40 lines (38 loc) · 865 Bytes
/
AVLTree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef AVLTREE_H
#define AVLTREE_H
#include<bits/stdc++.h>
#include"AVLNode.h"
using namespace std;
class AVLTree
{
private:
Node * root;
int size;
public:
AVLTree();
Node * Rigthrotate(Node * );
Node * Leftrotate(Node * );
int getdifference(Node * );
int height(Node *);
Node * createnode(string,string);
int compar(string,string);
void add(string,string);
void search(Node *,string);
Node * minright(Node *);
int number();
Node * deletenode(Node *, string );
void helpsearch(string);
void helpdelete(string);
void inorder(Node * );
void levelorder(Node * );
void printlevel(Node *, int );
void helpinorder();
void helplevel();
void helpprint(string,string);
void print(Node *,string,string);
int helpcount(string,string);
Node * insert(Node *,string, string);
int search1(Node * root,string key);
int count(Node *,string);
};
#endif