-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinaryTree.cpp
More file actions
41 lines (33 loc) · 1.25 KB
/
BinaryTree.cpp
File metadata and controls
41 lines (33 loc) · 1.25 KB
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
#include <iostream>
#include <sstream>
#include "AVL.hpp"
int main(int argc, const char *argv[]){
BT BinaryTree;
BT BinaryTree2;
int number;
int operations;
std::cin >> operations;
for(int i=0; i<24; i++){ //tutaj wprowadzić liczbę o jeden mniejszą niż numer linijki w której w pliku z którego wprowadzamy dan edo drzewa jest ostatni węzeł 1 drzewa
std::cin >> number;
BinaryTree.insert(number);
}
while(std::cin >> number){
BinaryTree2.insert(number);
}
std::cout << "DRZEWO 1:" << std::endl;
BinaryTree.print2DUtil();
std::cout << "DRZEWO 2:" << std::endl;
BinaryTree2.print2DUtil();
std::cout << "DZIELENIE DRZEWA 1:" << std::endl;
BT tree;
split(12, BinaryTree, tree);
std::cout << "DRZEWO O KLUCZACH MNIEJSZYCH LUB RÓWNYCH OD X:" << std::endl;
tree.print2DUtil();
std::cout << "DRZEWO O KLUCZACH wIĘKSZYCH OD X:" << std::endl;
BinaryTree.print2DUtil();
std::cout << "DRZEWO POWSTAŁE PO POŁĄCZENIU DRZEWA O KLUCZACH wIĘKSZYCH OD X I DRZEWA 2:" << std::endl;
join(BinaryTree, BinaryTree2);
BinaryTree2.print2DUtil();
std::cout << "KONIEC DZIAŁANIA PROGRAMU" << std::endl;
return 0;
}