this is for holding javascript data
Mazdak Farrokhzad edited Version 3.tex
over 10 years ago
Commit id: bb092cdb203f2b5094c8a4810ca8bd35ec99f488
deletions | additions
diff --git a/Version 3.tex b/Version 3.tex
index 4f2ccdc..e12973f 100644
--- a/Version 3.tex
+++ b/Version 3.tex
...
\subsubsection{Pedantic analysis}
\begin{quote}
For consistency, all operations count, even read/write.
\begin{lstlisting}
1 int maxSum = 0; (1 op)
2 int thisSum = 0; (1 op)
...
4 j < a.length; (1 op/turn + 1 extra at end of loop)
5 j++ ) { (1 op/turn)
6 thisSum += a[j]; (2 op/turn)
7 if( thisSum > maxSum ) {
(1 (2 op/turn, else-if is most complex: )
8 maxSum = thisSum; (1 op/turn)
9 seqStart = i; (1 op/turn)
10 seqEnd = j; (1 op/turn)
11 } else if( thisSum < 0 ) {
(1 (2 op/turn)
12 i = j + 1; (2 op/turn
13 thisSum = 0; (1 op/turn)
14 }