 By swapping the values "a"["i"] and "a"["j"] the heap property for position "i" is established.At this point, the only problem is that the heap property might not hold for index "j".The sift-down function is applied tail-recursively to index "j" until the heap property is established for all elements.