Sometimes, a queue does not operate on strictly first in first out (FIFO) basis. On the contrary, it stores
the elements according to the priority associated with each stored element. In a post office, the airmail
has a higher priority than the speed post and speed post in turn has more priority than an ordinary
mail. Therefore, the post office makes a queue of mail ordered by their priority, i.e., all airmail letters
are placed at the head of the queue followed by speed post letters. The speed post letters are followed by
registered parcels and so on. The ordinary mail with least priority lies at the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.