Skip to content
This repository was archived by the owner on Nov 26, 2019. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

L-ary Heap

An l-ary heap is general case of binary heap. All levels are filled with nodes except for the last level which is filled from left to right. A max l-ary heap is a tree where every parent node is greater than all of its child node This program ia about following...

  1. Build-heap for max l-ary heap
  2. Inserting a new element in the max l-ary heap.
  3. Search for an element x in max l-ary heap.
  4. Delete a given element and rearrange the tree to maintain the l-ary tree property

Interaction :

Input :

Enter the total number of elements you want to insert in the heap in starting: 12
Enter the elements one by one: 1 2 3 5 8 4 5 45 22 78 477 44
Enter the value of 'L' for your L-ary heap: 3

Output :

Built Heap : 477 8 78 44 2 4 5 45 22 3 5 1

Press your keyboard button according to following:
1 if you want to insert a new element in the tree.
2 if you want to search a element.
3 if you want to delete a element.
4 if you want to exit.

(Enter your choices accordingly and you will get Built heap after each operation as output.)

Implemented in: