Skip to content

Instantly share code, notes, and snippets.

@mnadeem
Last active August 29, 2015 14:16
Show Gist options
  • Save mnadeem/9b3dfa52c7f3959626fe to your computer and use it in GitHub Desktop.
Save mnadeem/9b3dfa52c7f3959626fe to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
% Insert the algorithm
\begin{algorithm}
\caption{Compute sum of integers in array}
\label{array-sum}
\begin{algorithmic}[1]
\Procedure{ArraySum}{$A$}
\State $sum = 0$
\For {each integer $i$ in $A$}
\State $sum = sum + i$
\EndFor
\State Return $sum$
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment