-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
61 lines (53 loc) · 968 Bytes
/
main.cpp
File metadata and controls
61 lines (53 loc) · 968 Bytes
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
#include "AVLTreeMenu.h"
#include "RBTreeMenu.h"
#include "Common.h"
#include <iostream>
#include <iomanip>
enum class StructMenu
{
AVLTree = 1,
RBTree = 2,
Exit = 0
};
int main()
{
bool exitProgramm = false;
while (exitProgramm != true)
{
std::cout << "Choose one of the struct:\n"
<< "1 - AVL-tree\n"
<< "2 - RB-tree\n"
<< "0 - Exit" << std::endl;
int structChoose = GetValue();
switch (static_cast<StructMenu>(structChoose))
{
case StructMenu::AVLTree:
{
AVLTree* tree = new AVLTree;
AVLTreeMenu(tree);
DeleteTree(tree->RootNode);
break;
}
case StructMenu::RBTree:
{
RBTree* rbTree = new RBTree;
RBTreeMenu(rbTree);
FreeTree(rbTree->Root, rbTree);
break;
}
case StructMenu::Exit:
{
exitProgramm = true;
break;
}
default:
{
std::cout << "Unknown command (" << std::endl;
system("pause");
break;
}
}
system("cls");
}
return 0;
}