-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbintree.h
59 lines (46 loc) · 1.04 KB
/
bintree.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
#ifndef _BINTREE_H_
#define _BINTREE_H_
#include "note.h"
typedef Note Item;
class BintreeStruct {
private:
BintreeStruct *Left;
BintreeStruct *Right;
void PrintLevel(size_t lvl);
public:
Item Value;
BintreeStruct(Item value);
~BintreeStruct(void);
void Push(Item value);
bool Pop(Item value);
BintreeStruct *Search(Item value);
void Print(void);
BintreeStruct *Min(void);
BintreeStruct *Max(void);
BintreeStruct *GetBranchLeft(void);
BintreeStruct *GetBranchRight(void);
Item GetValue(void);
size_t ElementsCount(void);
void Export(FILE *file);
};
class Bintree {
private:
BintreeStruct *Root;
public:
Bintree(void);
~Bintree(void);
void Push(Item value);
void Pop(Item value);
BintreeStruct *Search(Item value);
void Print(void);
BintreeStruct *GetRoot(void);
BintreeStruct *Min(void);
BintreeStruct *Max(void);
BintreeStruct *GetBranchLeft(void);
BintreeStruct *GetBranchRight(void);
bool IsEmpty(void);
size_t ElementsCount(void);
bool Import(std::string filename);
void Export(std::string filename);
};
#endif