**Pre-Requisites:**What are binary heaps?

See here.

I personally found the implementation given in the above GeeksForGeeks link very long.

The aim of this post is simply to provide a short and efficient implementation of min and max heap in C++.

This helps me to revise just before the placement interviews too. :P

**Advantage:**

**1.**Short and efficient code.

**2.**Works as both max-heap as well as min-heap.

Here is the link of code at ideone.

## No comments:

## Post a Comment