Notes

Source: 📖 Problem Solving with Algorithms and Data Structures using Python 7.10

Date: 2021-12-28


How a heap is ordered

Using a min-heap as an example, a heap is ordered such that any given node is smaller than or equal to its children. By extension, any given node is also greater than or equal to its parent.

image

For a max heap, the opposite applies.


See also: