Huffman Zipper  v-1.0
Data Compression and Decompression using Greedy Huffman Algorithm
PriorityQueue< T > Class Template Reference

This class models Priority Queue in which values are processed in order of priority. More...

#include <PriorityQueue.h>

Public Member Functions

void enqueue (const T &)
 Adds value to the priority queue
More...
 
dequeue ()
 Removes and returns the highest priority value. More...
 
top ()
 
bool isEmpty ()
 
int getSize ()
 
void display ()
 Prints the values of the priority queue. More...
 

Private Attributes

MinHeap< T > heap
 MinHeap Data Structure for Priority Queue implementation. More...
 

Detailed Description

template<class T>
class PriorityQueue< T >

This class models Priority Queue in which values are processed in order of priority.

It uses MinHeap as underlying data structure. So, lower value have higher priorities.

Definition at line 10 of file PriorityQueue.h.

Member Function Documentation

◆ dequeue()

template<class T >
T PriorityQueue< T >::dequeue

Removes and returns the highest priority value.

Definition at line 56 of file PriorityQueue.h.

◆ display()

template<class T >
void PriorityQueue< T >::display

Prints the values of the priority queue.

Definition at line 66 of file PriorityQueue.h.

◆ enqueue()

template<class T >
void PriorityQueue< T >::enqueue ( const T &  value)

Adds value to the priority queue

Definition at line 51 of file PriorityQueue.h.

◆ getSize()

template<class T >
int PriorityQueue< T >::getSize
Returns
the number of values in the priority queue.

Definition at line 46 of file PriorityQueue.h.

◆ isEmpty()

template<class T >
bool PriorityQueue< T >::isEmpty
Returns
true if the priority queue contains no elements.

Definition at line 41 of file PriorityQueue.h.

◆ top()

template<class T >
T PriorityQueue< T >::top
Returns
the highest priority value without removing it.

Definition at line 61 of file PriorityQueue.h.

Member Data Documentation

◆ heap

template<class T >
MinHeap<T> PriorityQueue< T >::heap
private

MinHeap Data Structure for Priority Queue implementation.

Definition at line 14 of file PriorityQueue.h.