Implementing Binomial Heap with one application and comparing the Heap operations with the AVL Tree So the main aim of this project was to implement all the operations of a Binomial Heap like insert,delete,merge etc. and then compare the running time of these operations when the same operations is being performed on AVL Trees as well. This project also invloves creating one application where Binomial Heaps can be used.
The following instruction will help you how to copy and run the project on your local machine for testing purposes.
To compile, type the command g++ -std=c++11 AVL.cpp -o avl
To execute, type ./avl
To compile, type the command g++ -std=c++11 binomial1.cpp -o binomial
To execute, type ./binomial
To compile, type the command g++ -std=c++11 dij.cpp -o dij
To execute, type ./dij
AVL Tree will contain only unique values. On successful compiltation, the program will have a menu driven functionality in which the user needs to enter which functionality he/she needs to perform.
On selecting this operation the user needs to first enter the number of nodes he/she needs to insert into the AVL Tree and then accordingly enter the node's value to be inserted in the AVL Tree.
It display the AVL Tree in InOrder fashion.
It asks for the node value to be deleted and then prints the output message of the operation accordingly
It prints the smallest element present in the AVL Tree.
It returns the smallest element from the AVL Tree. It removes the smallest element from the tree as well.
It invloves merging two AVL Trees. For this operation, the user needs to create a second new AVL Tree(through this operation only) and then this newly created tree will be merged with the already present AVL tree.
On successful compiltation, the program will have a menu driven functionality in which the user needs to enter which functionality he/she needs to perform.
On selecting this operation the user needs to first enter the number of nodes he/she needs to insert into the Binomial Heap and then accordingly enter the node's value.
On selecting this operation, the user needs to type the key of the node to be deleted. If it is present in the heap, it will be deleted; else an error message would be displayed.
This operation would print the smallest element present in the heap and also delete it from the heap.
This operation would require the user to input another heap and then this heap would be merged with the existing heap and would be printed.
On selecting this operation, the user needs to type the key of the node whose key is to be decreased. If the node is not present in the heap, an error is printed; else, A new key is requested from the user. The value of this key is checked if it is greater than the node's key. If it is, then an error is printed; else the node's key is decreased.
This operation prints all the nodes currently present in the heap.
Dijkstra's algorithm have been implmented using binomial heap.