A Priority Queue is a linear structure in which each item is associated with a priority and an item with higher priority takes place in front of the item with lower priority.
During insertion: Insert new item from any end, since the position depends upon the priority.
During deletion: Remove item from front only.
Rule 1: The element with the highest priority pointed by FRONT should be processed (and deleted if required) first.
Rule 2: In case of equal priority, the element with earlier timestamp should be processed first.
Implementation:
a. Linked list
b. Array
My socials:
[email protected]
https://psnacademy.in
/ psnayak
/ psnayakeducator
https://www.buymeacoffee.com/psnayak
/ psnayak2007
Note: This video is copyrighted, no part of it to be reproduced or republished.
Thumbnail background image: http://www.freepik.com | Designed by pch.vector / Freepik