August 2024
Intermediate to advanced
516 pages
11h 47m
English
Now that we’ve discovered the tree, we’ve unlocked many new data structures. In the previous chapter, we focused specifically on the binary search tree, but there are many other types of trees as well. Like all data structures, each type of tree comes with its own benefits and drawbacks, and the trick is knowing which one to harness in a specific situation.
In this chapter we’ll explore the heap, a type of tree data structure that has special powers that can be leveraged for specific scenarios, in particular when we want to constantly keep tabs on the greatest or least data element in a dataset.
To appreciate what a heap can do, let’s take a look at a completely different data structure: ...
Read now
Unlock full access