Heap datastructure in pictures

A binary heap (generally referred as heap) is a rooted left-complete binary tree which has two properties 1) heap property 2) shape property Wow. Now, that is a lot of jargon. Let's see what each word in the definition means. What is a tree? A tree is just a set…