O'Reilly logo

Everyday Data Structures by William Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Heaps: Ordered Trees

Heaps are a special category of the tree data structure, that are ordered with respect to the value of the tree's nodes or the keys associated with each node. This ordering is either ascending in a min heap, meaning that the root node is smaller in value or priority than it's child nodes, or descending in a max heap, meaning that the root node is larger in value or priority than it's child nodes. Note that heap data structures should not be confused with the heap memory of a computer system, which is the name typically used for system's dynamically allocated memory.

In this chapter we will cover the following topics:

  • Defining the heap data structure
  • Array implementation
  • Creating heaps
  • Common operations

Heap implementations ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required