At first glance, one might not be able to distinguish between the two trees above, because you know, they all look similar. However, on getting a closer look, the nodes seem to be ordered in some logical way. In the figure above, the tree on the left is a Binary Search Tree and the one on the right is a Binary Heap, specifically a Min Heap. Both of them are binary trees, but each follows a different set of rules.

A binary heap is simply a binary tree that obeys the following rules -

- The tree must be
**complete**—…