Showing posts with label Concept Of Heap Tree. Show all posts
Showing posts with label Concept Of Heap Tree. Show all posts

Analysis Design Of Algorithm (ADA) | Heap and Heap Sort Concept


📌Highlights: Hi friends ! In this post I am going to discuss about the concept of  Heap and Heap sort algorithm such as what is heap ?, Type of heap, Array representation of heap and examples.

Heap is a special type of binary tree. It is a complete binary tree and must satisfy heap property. 

Heap property says that the key value of parent node must be (greater than or equal to) or (Lesser than or equal to) the value of child node.

Now for understanding heap tree let we discuss about binary tree first.

Binary tree is a tree in which every parent have not more than two children. Binary tree are classified into following:

1. Full Binary Tree :

A binary tree in which every node has either 0 or 2 children. A single node is also a binary tree. 

Example: