-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor comments and variables to english
- Loading branch information
1 parent
cb4ecaa
commit f1a1095
Showing
8 changed files
with
293 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
#include "no.h" | ||
#include "node.h" | ||
#include <unordered_map> | ||
using namespace std; | ||
|
||
class MinHeap{ | ||
private: | ||
int elementsQty; // current size (number of elements) | ||
int max; // max size | ||
No** pointerArr; // array of pointers of Node type | ||
private: | ||
int elementsQty; // current size (number of elements) | ||
int max; // max size | ||
Node** pointerArr; // array of pointers of Node type | ||
|
||
public: | ||
public: | ||
/* | ||
* Build a heap receiving the size, the text and the map structure that stores | ||
* occurrence frequency of each character in text | ||
*/ | ||
MinHeap(unordered_map<char, int>); | ||
|
||
// Due dinamic array alocation, exists a destructor to desalocate memory | ||
~MinHeap(); | ||
|
||
/* | ||
* Build a heap receiving the size, the text and the map structure that stores | ||
* occurrence frequency of each character in text | ||
*/ | ||
MinHeap(unordered_map<char, int>); | ||
|
||
// Due dinamic array alocation, exists a destructor to desalocate memory | ||
~MinHeap(); | ||
|
||
void goUp(int); | ||
void goDown(int); | ||
void buildHeap(); | ||
void insert(No*); | ||
No* removeMin(); | ||
bool isLeaf(No*); | ||
void goUp(int); | ||
void goDown(int); | ||
void buildHeap(); | ||
void insert(Node*); | ||
Node* removeMin(); | ||
bool isLeaf(Node*); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Definition of Node strucutre used in MinHeap and Huffman tree structures. | ||
class Node { | ||
private: | ||
char info; // character | ||
int freq; // character frequency | ||
Node* left; | ||
Node* right; | ||
|
||
public: | ||
Node(char, int); | ||
Node(); | ||
|
||
// setters | ||
void setInfo(char); | ||
void setFreq(int); | ||
void setLeft(Node*); | ||
void setRight(Node*); | ||
|
||
// getters | ||
char getInfo(); | ||
int getFreq(); | ||
Node* getLeft(); | ||
Node* getRight(); | ||
}; |
Oops, something went wrong.