-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNodo.h
42 lines (29 loc) · 1.06 KB
/
Nodo.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
#ifndef NODO_H_INCLUDED
#define NODO_H_INCLUDED
using namespace std;
#include "Colore.h"
class Nodo {
private:
int key;
Nodo* parent;
Nodo* sx;
Nodo* dx;
Colore color;
public:
Nodo (int k = -1, Nodo* p = NULL, Nodo* s = NULL, Nodo* d = NULL, Colore c=NULLO): key (k), parent(p), sx (s), dx (d), color(c) {}
Nodo (Nodo* copia): key(copia->key), parent(copia->parent), sx(copia->sx), dx(copia->dx){color=copia->GetColor().get();}
//METODI GET
Nodo* GetParent() const {return parent;}
Nodo* GetSx() const {return sx;}
Nodo* GetDx() const {return dx;}
int GetKey() const {return key;}
Colore GetColor() const {return color;}
void SetColor(hide_color x) {color = x;}
void SetColor(Colore x) {color = x;}
//METODI SET
Nodo* SetParent(Nodo* p) {return parent=p;}
Nodo* SetSx(Nodo* s) {return sx=s;}
Nodo* SetDx(Nodo* d) {return dx=d;}
int SetKey(int k) {return key=k;}
};
#endif // NODO_H_INCLUDED