Last active
August 29, 2015 14:16
-
-
Save mnadeem/9b3dfa52c7f3959626fe to your computer and use it in GitHub Desktop.
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
\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