Fix index variable

This commit is contained in:
Antti H S Laaksonen 2017-07-29 11:32:56 +03:00
commit 5a927cc4a0
3 changed files with 3 additions and 3 deletions

BIN
book.pdf

Binary file not shown.

View File

@ -457,8 +457,8 @@ After this change, the time complexity is $O(n^2)$.
Surprisingly, it is possible to solve the problem
in $O(n)$ time\footnote{In \cite{ben86}, this linear-time algorithm
is attributed to J. B. Kadene, and the algorithm is sometimes
called \index{Kadene's algorithm} \key{Kadene's algorithm}.}, which means
is attributed to J. B. Kadane, and the algorithm is sometimes
called \index{Kadane's algorithm} \key{Kadane's algorithm}.}, which means
that just one loop is enough.
The idea is to calculate, for each array position,
the maximum sum of a subarray that ends at that position.

View File

@ -28,6 +28,6 @@ You can always send feedback on the book to
\texttt{ahslaaks@cs.helsinki.fi}.
\begin{flushright}
Helsinki, June 2017 \\
Helsinki, July 2017 \\
Antti Laaksonen
\end{flushright}