A queue is a FIFO data structure i.e First In First Out.
Priority queue as the name suggests should have the elements or tasks ordered with respect to priority in the queue.If two elements have the same priority than they
will be executed in the sequence they are added in the list.
The main operations for implementing a priority queue are:
Push operation:This function is used to insert new data into the queue based on priority.Pseudocode for Push operation:
PUSH(HEAD,DATA,PRIORITY):
Step 1:...
Published on April 23, 2021 04:00