-
Notifications
You must be signed in to change notification settings - Fork 0
/
AVLTree.h
42 lines (31 loc) · 815 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
41
42
#ifndef AVLTREE_H
#define AVLTREE_H
#include "node.h"
class AVLTree : public node
{
private:
node* root;
node* addLeafPrivAVL(string, node*);
int Height(node*);
int max(int, int);
node* RightRotation(node* &);
node* LeftRotation(node* &);
node* doubleRightRotation(node* &);
node* doubleLeftRotation(node* &);
node* DeleteNodePrivAVL(string,node*);
node* min(node*);
public:
AVLTree();
void addLeaf(string);
void FindNode(string*);
void DeleteNode(string);
void InOrder();
void PreOrder();
void PostOrder();
node* CreateLeaf(string key);
node* FindNodePriv(string, node*);
void InOrderPriv(node*);
void PreOrderPriv(node*);
void PostOrderPriv(node*);
};
#endif // AVLTREE_H