\begin{algorithm}
\caption{Heap Increase Key}
\begin{algorithmic}
\PROCEDURE{HeapIncreaseKey}{$A, i, key$}
\IF{$key < A[i]$}
\STATE \textbf{error} "new key is smaller than the current key"
\ENDIF
\WHILE{$i > 1$ \AND $A[PARENT(i)] < key$}
\STATE $A[i] = A[PARENT(i)]$
\STATE $i = PARENT(i)$
\ENDWHILE
\STATE $A[i] = key$
\ENDPROCEDURE
\end{algorithmic}
\end{algorithm}