What is a priority queue
What is a priority queue
A priority queue is an abstract data type similar to a regular queue or stack data structure, but with an added feature: each element has a priority associated with it. Elements are served based on their priority. Higher-priority elements are served before lower-priority ones. If two elements have the same priority, they are served according to their order in the queue.