\begin{algorithm} \caption{Bubble-Sort($A[1..n]$)} \begin{algorithmic} \FOR {$i = 1$ \TO $n - 1$} \FOR {$j = n$ \DOWNTO $i + 1$} \IF{$A[j] < A[j-1]$} \STATE \CALL{Swap}{$A[j], A[j - 1]$} \ENDIF \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm}