Binary Min Heap is a Binary Heap with a condition:
Implement a Data Structure that respond to this condition and write methods Insert()
, GetMin()
, PopMin()
.
This implementation contains a class
MinHeap with implemented methods Insert()
, GetMin()
, PopMin()
.
Balancing of a heap is implemented with sift_up
and Heapify
operations:
-
sift_up
operation implements comparison of an element at anindex
of array with it's parent (element at(index-1)/2
of array). Following by performing aswap
if Condition of a Heap was violated (array[parent] > array[index]
) -
Heapify
operation implements a comparison of an element of array atindex
to its left and right children. Minimal element is swapped with element atindex
.
make
helps generate main and test binaries to run tests or interactive main program.
make build
make run
make test
make clean