Breaking Posts

6/trending/recent

Hot Widget

Type Here to Get Search Results !

Heap Tree

  • Heap data structure is a specialized binary tree-based data structure. Heap is a binary tree with special characteristics. In a heap data structure, nodes are arranged based on thier value. A heap data structure, some time called as Binary Heap.
  • There are two types of heap data structures and they are as follows...
  1. Max Heap
  2. Min Heap
Every heap data structure has the following properties...
Property 1 (Ordering): 
  • Nodes must be arranged in a order according to values based on Max heap or Min heap.
Property 2 (Structural): 
  • All levels in a heap must full, except last level and nodes must be filled from left to right strictly.

Max Heap

  • Max heap data structure is a specialized full binary tree data structure except last leaf node can be alone. In a max heap nodes are arranged based on node value.

Max heap is defined as follows...
"Max heap is a specialized full binary tree in which every parent node contains greater or equal value than its child nodes. And last leaf node can be alone."
Example
  • The above tree is satisfying both the Ordering property and Structural property according to the Max Heap data structure.

Operations on Max Heap

The following operations are performed on a Max heap data structure...
  1. Finding Maximum (It's easy to find the node in a max heap with the highest value. The root node in a max heap has the highest value of all the other nodes. As a result, we can display the value of the root node as the maximum value in the max heap.)
  2. Insertion Operation in Max Heap
  3. Deletion Operation in Max Heap


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.