Chapter 26
Priority Queues
The queue Abstract Data Type (ADT) that we have looked at previously can be thought of as modeling a service line. All the entities that are added in are considered equal, and they are taken off in the order they arrive. Not every system works in such an equitable way. In real life there are things like VIP lines. Some systems have a serious reason to treat entities differently. An example of such a system is an emergency room. If you show up to an ER with a paper cut, you can expect to wait for a very long time. This is because the order in which people are served in an ER is based much more on the seriousness of the person's condition than on the time of arrival. Situations where people set up appointments are another ...
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.
Read now
Unlock full access