algorithm

Implement Max Heap in Java

Posted on Updated on

Max Heap:

Here in this blog we should see implementation of Max Heap.

The value of each node is less than or equal to value of its parent. Thus, root contains max value. Read the rest of this entry »

Implement Min Heap in Java

Posted on Updated on

Min Heap:

Here in this blog we should see implementation of Min Heap.

The value of each node is greater than or equal to value of its parent. Thus, root contains min value. Read the rest of this entry »

Binary Heap

Posted on Updated on

Heap data structure is widely use in software languages like C, C++, Python, Java etc. There are different type of heaps like Binary Heap, Fibonacci Heap, Binomial Heap and so on. Out of these, Binary Heap is more popular and others are variations of it. Following are the properties of Binary Heap.

  1. Binary tree property: It’s a complete tree i.e All levels are completely filled except last levels which has all keys as left as possible.
  2. Binary Heap is either a Max heap or Min Heap.

Read the rest of this entry »