Learning heap data structure
This project show-case running example for both Min and Max heap. It is designed to work for all kinds of number like Integer, Long, BigDecimal, etc
There is two API exposed to operate on the binary tree.
- Push - Used to add the element in the tree.
- Pop - Used to delete the element in the tree.
Min Heap
- As part of insertion, Data would be sorted in ascending order
- When you try to pop the element, You will be get minimum element
Max Heap
- As part of insertion, Data would be sorted in descending order
- When you try to pop the element, You will be get maximum element