-
Notifications
You must be signed in to change notification settings - Fork 0
/
avl.h
61 lines (60 loc) · 1.6 KB
/
avl.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include "node.h"
#include "window.h"
#include "edge.h"
#include<SFML/Graphics.hpp>
class Avl
{
public:
Avl();
struct node* maketree(int b);
void add(std::string a);
int convert(std::string a);
struct node* auxadd(int key,struct node* ptr);
struct node* rebalance_left(struct node* p);
struct node* rebalance_right(struct node* p);
struct node* rotate_right(struct node* a);
struct node* rotate_left(struct node* a);
void del(std::string );
struct node* auxdel(struct node* rot, int key);
struct node* balance_left(struct node* inp);
struct node* balance_right(struct node* inp);
int find_min(struct node* a);
void display();
void bfs(node* root);
void printGivenLevel(node* root, int level, int );
void preorder(struct node* a);
void inorder(struct node* a);
void print_height();
int height(struct node* ro);
int auxheight(struct node* ptr);
void render(Window &w);
void levels(node*,int,Window&);
std::string numtostr(int);
using Nodecont=std::vector<node>;
Nodecont container;
using edgecont=std::vector<edge>;
edgecont edges;
static int mat[5][32];
void setpos(struct node* ,int );
void sear(std::string s);
void setedges(struct node* ,sf::Vector2f);
private:
// Node nodes[15];
int available;
struct node* root;
int total;
int xpos;
int ypos;
static int called;
static int counter;
static int calls;
static int calls2;
static int num;
std::string in;
std::string pre;
sf::Text ino;
sf::Text preo;
// Window win;
//int num;
};