Skip to content

hkj23/Priority_queue_Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Priority_queue_Implementation

Implementation of a priority queue using a max heap. To use the priority queue:

->include "MaxHeap.h" in your source file. ->declare a MaxHeap as "MaxHeap < myDataType > myMaxHeap(comparator)". ->you need to define a function comparator that accepts two objects of type myDataType and returns true if 1st compares less than 2nd object and false otherwise. ->the highest priority object(does not compare less than any other object in the heap) is the topmost item in the heap.

The following functionalities are provided:

->push(T obj) : inserts in the queue the item obj. ->pop() : deletes the highest priority item from the queue. ->top() : returns the highest priority item present in the queue. ->isEmpty() : return 1 if there is no element in the queue. 0 otherwise.

About

Implementation of a priority queue using a max heap

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages