333
 правки
Изменения
→siftDown
 '''function''' siftDown(i : '''int'''):
     '''while''' 2 * i + 1 < A.heapSize     <font color = "green">// heapSize {{---}} количество элементов в куче</font>
         left = 2 * i + 1                      <font color = "green">// left {{---}} левый сын</font>         right = 2 * i + 2                    <font color = "green">// right {{---}} правый сын</font>
         j = left
         '''if''' right < A.heapSize '''and''' A[right] <= A[left]