output and reheap
interchange(data,1,last);
last--;
shift(data,root,last);