Implementation of the max priority queue and providing some functions such as getting length, inserting and deletion using Python
In this Python project, we implement the class for Max Priority Queue which includes the following Python functions. Priority queue is an abstract data type similar to stack data structure in addition to providing a priority for each value that is entered into a stack. The operations are similar to that of a stack data structure. The below-mentioned functions can be performed on the priority queue.
This function will return the size of the priority queue or it will give the number of elements present in the queue.
This function will return a true or false value for whether the following priority queue is empty or not. In other terms, it will return true or false for whether a queue's size is zero or not
This function is used to insert the values into the queue along with the priority mentioned.
This function is used to get the maximum value of the queue and in case if the queue is empty, then it will return infinity.
This function is used to find out the maximum value using 'getMax' and then delete the value from the queue. If the queue is empty, then it will return infinity
Submitted by Patnam Venkata Koushik (Koushik)
Download packets of source code on Coders Packet
Comments