Explain the Priority Queue.
Priority Queue: Linked list class has been enhanced to implement the queue interface. Queues can be handled with a linked list. Purpose of a queue is “Priority-in, Priority-out”.
Hence elements are ordered either naturally or according to the comparator. The elements ordering represents their relative priority.