-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCell.cpp
More file actions
60 lines (54 loc) · 849 Bytes
/
Cell.cpp
File metadata and controls
60 lines (54 loc) · 849 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include"Cell.h"
#include <stdio.h>
cell::cell()
{
}
cell::cell(int size, cell* left, cell* right)
{
{
this->size=size;
leaf=false;
this->left=left;
this->right=right;
}
}
cell::cell(char element, int size)
{
this->size=size;
this->element=element;
leaf=true;
}
bool cell::isMore(cell cell)
{
if(this->size>cell.size)
{
return true;
}
else
{
return false;
}
}
int cell::getSize()
{
return this->size;
}
char cell::getElement()
{
if(this->leaf)
{
return this->element;
}
else
{
return ' ';
}
}
void cell::setHuffmanRepresentation(long int huffman)
{
sprintf(this->huffmanRepresentation,"%ld",huffman);
}
QString cell::getHuffmanRepresentation()
{
return QString(huffmanRepresentation).remove(0,1);
}