Created
November 12, 2015 00:43
-
-
Save mitliagkas/bac9c97fc85e45dad921 to your computer and use it in GitHub Desktop.
Latex Algorithm Listing (taken from ICML 2015 stylefile)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{algorithm}[tb] | |
\caption{Bubble Sort} | |
\label{alg:example} | |
\begin{algorithmic} | |
\STATE {\bfseries Input:} data $x_i$, size $m$ | |
\REPEAT | |
\STATE Initialize $noChange = true$. | |
\FOR{$i=1$ {\bfseries to} $m-1$} | |
\IF{$x_i > x_{i+1}$} | |
\STATE Swap $x_i$ and $x_{i+1}$ | |
\STATE $noChange = false$ | |
\ENDIF | |
\ENDFOR | |
\UNTIL{$noChange$ is $true$} | |
\end{algorithmic} | |
\end{algorithm} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment