-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtree.h
More file actions
49 lines (41 loc) · 1.13 KB
/
Copy pathtree.h
File metadata and controls
49 lines (41 loc) · 1.13 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
42
43
44
45
46
47
48
49
#pragma once
#include <vector>
#include <QPoint>
namespace Tree {
struct Data {
int val;
int level;
int pos;
int posX{0};
int posY{0};
bool new_node{false};
};
class Node
{
public:
const int DrawingSize{34};
const QPoint start_pos{360,150};
static int left_nodes;
static int right_nodes;
Data _data;
bool Contain(int number);
int GetSmallestNumber();
int GetLargestNumber();
void GetSortedVector(std::vector<int>& a);
void Insert(Data NewData);
bool IsSymetrical();
void ResetLastLabel();
std::vector<Data> SetPositionOfNodesForVisualization();
std::vector<QPoint> GetVectorOfLinesBetwenNodes();
Node(Data NewData);
~Node();
private:
Node *_left = nullptr, *_right = nullptr;
void ReturnDataVector(std::vector<Data>& vector);
void LoopForLinesConnection(std::vector<QPoint>& vec);
void SetDataForDrawing(Node& root);
void SetPos(int& pos);
void SetLevel(int& level);
void SymetricalChecking(std::vector<int>& vec);
};
}