Min Heap Visualization

# Min heap

Min heap are following properties.

1) That is complete Binary tree.

2) Parent key value are smaller than child key value.

## Check this given tree are min heap or not?

This Given tree are 11 nodes and there are complete fill then this are satisfied 1 propeties. Know check second properties. Parent node are smaller to child node.

Parent node  value is smaller in left and right child [98,194]. that means this node are satisfied second condition. check other node.

Check node 

Parent node  value is smaller in left and right child [128,452]. that means this node are satisfied second condition. check other node.

Check another node 

Parent node  value is greater in left child . that means this is not min heap.

## Min heap conversion

### Convert This Tree to Min heap step by step

Node  is not satisfied min heap. then swapping the node values 128 to 2.

Note that after swapping this two node value again check previous node. In this time checking the node .

Node [98 value] are bigger to left child then swap those value [98<=>2].

In this time swapping the values of [98<=>20].

Check node .

Swap node data [452<=>35]

Check Node .

Check node .

Swap node data [42<=>2].

Check node .

Swap node Data [20<=>49].

Check node .

Swap node data [85<=>194].

Finally Tree is convert to min heap

## How To Insert Min heap node

Insert node . In given Tree.

After insert

After insert node . tree are not min heap then convert.

Swap node data [1<=>198].

Check Node .

Swap node value [1<=>85].

Check Node .

Swap node value [1<=>2].

Convert Min Heap.

How to use

Suppose following [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] data are inserted on min heap. Put your data separated by hyphen-minus sign (-) and putting on input field.

Like This 10-9-8-7-6-5-4-3-2-1.

showing on input field and click to submit button . And view min heap operation like insertion and deletion.

https://www.codelike.in/animation/binary-min-heap/

Possible to submit any number of positive numeric value but separate by (-) minus symbol. Note that if you have not given any data. So this editor will put default 10 numeric value.