 Both operations take O(log "n") time.To add an element to a heap we must perform an "up-heap" operation (also known as "bubble-up", "percolate-up", "sift-up", "trickle-up", "swim-up", "heapify-up", or "cascade-up"), by following this algorithm