-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinary_tree.h
38 lines (33 loc) · 860 Bytes
/
binary_tree.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
#ifndef BINARY_TREE_H_INCLUDED
#define BINARY_TREE_H_INCLUDED
#include <stdlib.h>
#include <stdbool.h>
#include "strings.h"
#include "mmu.h"
#include "errors.h"
typedef struct tBTreeNode {
struct tBTreeNode *right;
struct tBTreeNode *left;
void *data;
tString *key;
int height;
} *tBTNode;
typedef struct{
tBTNode root;
tBTNode lastAdded;
//nevim co jeste sem dat
}tBTree;
int Max( int, int);
void btInit(tBTree*);
void btFree(tBTree*);
void deleteNodes(tBTNode);
tBTNode btFind(tBTree*,tString*);
tBTNode searchNodes(tBTNode, tString*);
tBTNode singleRotateLeft(tBTNode);
tBTNode singleRotateRight(tBTNode);
tBTNode doubleRotateLeft(tBTNode);
tBTNode doubleRotateRight(tBTNode);
E_CODE BTInsert (tBTree*, tString*,void*);
tBTNode AVLinsertNode(tBTNode,tString*, void*);
void AVLBTInsert(tBTree*, tString*,void*);
#endif