our new element has been swapped and moved up to index we have not reached the top of the heap yet ( )so we continue the new parent of our element is at index / so we compare andif necessaryswap againafter the final swapwe are left with the heap looking as follows notice how it adheres to the definition of heap