\begin{algorithm}
\caption{Young Sort}
\begin{algorithmic}
\INPUT a sequence $A$ of $n^2$ elements to be sorted
\OUTPUT a sorted sequence of the input sequence
\STATE let $Y$ be an $n \times n$ matrix with all elements initialized to be $\infty$
\FOR{$i = 1$ \TO $n^2$}
\STATE \CALL{YoungInsert}{$Y, A[i]$}
\ENDFOR
\FOR{$i = 1$ \TO $n^2$}
\STATE $A[i] =$ \CALL{YoungExtractMin}{$Y$}
\ENDFOR
\end{algorithmic}
\end{algorithm}