-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (30 loc) · 972 Bytes
/
main.cpp
File metadata and controls
33 lines (30 loc) · 972 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
#include <QDebug>
#include"cell.h"
#include"treemanipulation.h"
int main()
{
cell* root=new cell(4);
TreeManipulation tree=TreeManipulation(root);
tree.insection(tree.getRoot(),new cell(2));
tree.insection(tree.getRoot(),new cell(6));
tree.insection(tree.getRoot(),new cell(1));
tree.insection(tree.getRoot(),new cell(3));
tree.insection(tree.getRoot(),new cell(5));
tree.insection(tree.getRoot(),new cell(7));
tree.insection(tree.getRoot(),new cell(15));
tree.insection(tree.getRoot(),new cell(14));
tree.insection(tree.getRoot(),new cell(13));
while(tree.isAVL(tree.getRoot())!=0)
{
tree.buildAVL(tree.getRoot());
}
tree.insection(tree.getRoot(),new cell(80));
tree.insection(tree.getRoot(),new cell(8));
root=tree.getRoot();
tree.remove(root,new cell(4));
while(tree.isAVL(tree.getRoot())!=0)
{
tree.buildAVL(tree.getRoot());
}
tree.printTree(tree.getRoot());
}