Skip to Content
Data Structures the Fun Way
book

Data Structures the Fun Way

by Jeremy Kubica
October 2022
Beginner to intermediate
304 pages
8h 30m
English
No Starch Press
Content preview from Data Structures the Fun Way

7 Priority Queues and Heaps

Priority queues are a class of data structures that retrieve items ordered by given scores for each item. Whereas both stacks and queues from Chapter 4 depended solely on the order in which data was inserted, priority queues use an additional piece of information to determine the retrieval order—the item’s priority. As we will see, this new information allows us to further adapt to the data and, among other useful applications, allows us to process urgent requests first.

For example, imagine a new coffee shop, Dynamic Selection Coffee, has opened in your neighborhood. Bursting with excitement, you venture into ...

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.
Start your free trial

You might also like

Grokking Data Structures

Grokking Data Structures

Marcello La Rocca
Grokking Algorithms

Grokking Algorithms

Aditya Bhargava

Publisher Resources

ISBN: 9781098156602Errata Page