heapifyup
Heapifyup is a procedure used in heap data structures to restore the heap property after inserting a new element. It can also be used when a key becomes more extreme in a heap, such as increasing a key in a max-heap or decreasing a key in a min-heap.
In a binary heap implemented with an array, a new element is appended at the end, and
Indexing details: with 0-based indexes, the parent of index i is floor((i-1)/2); with 1-based indexes, the parent