-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHuffmanNo.cpp
51 lines (40 loc) · 1011 Bytes
/
HuffmanNo.cpp
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
#include "HuffmanNo.h"
// Construtor
HuffmanNo::HuffmanNo(char dado, int frequencia) {
this->dado = dado;
this->frequencia = frequencia;
this->esquerda = nullptr;
this->direita = nullptr;
}
// Destrutor
HuffmanNo::~HuffmanNo() {}
// Início Getters e Setters
char HuffmanNo::getDado() {
return this->dado;
}
void HuffmanNo::setDado(char dado) {
this->dado = dado;
}
int HuffmanNo::getFrequencia() {
return this->frequencia;
}
void HuffmanNo::setFrequencia(int frequencia) {
this->frequencia = frequencia;
}
HuffmanNo *HuffmanNo::getEsquerda() {
return this->esquerda;
}
void HuffmanNo::setEsquerda(HuffmanNo *esquerda) {
this->esquerda = esquerda;
}
HuffmanNo *HuffmanNo::getDireita() {
return this->direita;
}
void HuffmanNo::setDireita(HuffmanNo *direita) {
this->direita = direita;
}
// Fim Getters e Setters
// Função para verificar se o Nó é folha
bool HuffmanNo::ehFolha() {
return this->esquerda == nullptr && this->direita == nullptr;
}