June 2018
Intermediate to advanced
316 pages
6h 34m
English
Each node of a binary heap has no more than two children. In a binary heap, the order of levels is important, but the order of values at the same level isn't important. There are two types of binary heaps—max and min. A max binary heap places the largest value in the top node, and a min binary heap places it in the bottom node.
The following diagram shows a max heap:

This diagram shows a min heap:

Read now
Unlock full access