-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAVLTree.h
29 lines (28 loc) · 881 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
//H. Eren Çalýk
//21402338
//Section 1
//
#include "AVLNode.h"
#include <string>
//----------------------------------------------AVLTree.h
class AVLTree{
private:
AVLNode* root;
void singleRightRotate(AVLNode * & n);
void doubleRightRotate(AVLNode * & n);
void singleLeftRotate(AVLNode * & n);
void doubleLeftRotate(AVLNode * & n);
void insert(const std::string & str, AVLNode * & node);
bool isThere( const std::string& str, AVLNode * & node);
bool isThereSub( const std::string& str, AVLNode * & node);
void findOthers(const std::string & str,AVLNode * & node);
public:
AVLTree();
~AVLTree();
void insert(const std::string & str);
void findOthers(const std::string & str,int size);
bool isThere(const std::string &str);
bool isThereSub(const std::string &str,int size);
int avlHeight (AVLNode * node);
int max(int num1, int num2);
};