-
Notifications
You must be signed in to change notification settings - Fork 0
/
Avl.hpp
39 lines (35 loc) · 1007 Bytes
/
Avl.hpp
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
#pragma once
#include <iostream>
//#include <SFML/Graphics.hpp>
#include "Node.hpp"
using namespace std;
class Avl
{
private:
Node *root;
Node *LLRotation(Node *);
Node *LRRotation(Node *);
Node *RLRotation(Node*);
Node *RRRotation(Node *);
int NodeHeight(Node *);
int BalanceFactor(Node *);
Node *pre(Node *);
Node *succ(Node *);
public:
Avl();
~Avl();
Node *Insert(Node * , int );
Node *Delete (int key, Node *);
Node *getroot();
void setroot(Node *);
void Preorder(Node *);
void draw(Node *,sf::RenderWindow&);
void setCordinate(Node *,int );
// Node* singleRightRotate(Node* );
// Node* singleLeftRotate(Node* );
// Node* doubleLeftRotate(Node* );
// Node* doubleRightRotate(Node* );
void setbackcolor(Node *,bool &);
Node *Search(int,Node *);
void setspcolor(Node *,bool &, sf::Clock &);
};