Skip to content
Snippets Groups Projects
Commit 9a1adf82 authored by Christopher Alan Lif's avatar Christopher Alan Lif
Browse files

Commit Test for hw1.5

parent d3dbfe95
No related branches found
No related tags found
No related merge requests found
......@@ -30,10 +30,23 @@
\begin{document}
\title{Homework~X.Y}
\author{\dots}
\date{August~XX,~20YY}
\dots % Write content here.
\title{Homework~1.5}
\author{Christopher Lif}
\date{August~31,~2017}
\paragraph{1.} The recursive algorithm is used to find the difference of all the elements of a list.
An iterative version of the algorithm is as follows:
\begin{pseudocode}
\textbf{function:} iterativeReduction(\textit{A})
\textbf{Input:} \textit{A}, a list of numbers
\(1 if |A| > 0\)
\(2 | total \gets A[0]\)
\(3 | \textbf{for} a \in A, sequentially by i:\)
\(4 | | total = total - A[i]\)
\(5 | return total\)
\(6 return 0\)
\end{pseudocode}
\end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment