-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrequencyCounter.h
33 lines (30 loc) · 922 Bytes
/
FrequencyCounter.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
//FrequencyCounter.h
/*
Class Description: Class designed to create a frequency table that stores characters and
the frequency with which they appear.
Class Invariants:
Author: Jiacheng Xu & Carla Louw
Date: March 17, 2019
*/
#pragma once
#include "HuffmansTree.h"
#include "PriorityQueue.h"
class FrequencyCounter
{
private:
long int weightOfAsciiTable[256];
int characters[256];
int charactersNumber;
public:
//Description: Default Constructor
FrequencyCounter();
//Description: Adds a character to the frequency table
//Postcondition: The frequency of the character is
// incremented
void addCharacter(char ch);
//Description: Takes the frequency and builds it into the
// approptiate position of the priority queue
//Postcondition: Character with it's new frequency is created as a piece
// for the tree and inserted into the priority queue
void buildingTrees(PriorityQueue* Q);
};