From d8a26a6274b1043606b1bd7f57fb4dd7c52e17d6 Mon Sep 17 00:00:00 2001 From: Antti H S Laaksonen Date: Wed, 1 Feb 2017 00:21:48 +0200 Subject: [PATCH] LIS better --- luku07.tex | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/luku07.tex b/luku07.tex index a96605a..c8c7667 100644 --- a/luku07.tex +++ b/luku07.tex @@ -465,7 +465,7 @@ Let $f(k)$ be the length of the longest increasing subsequence that ends at position $k$. Using this function, the answer to the problem -is the largest of values +is the largest of the values $f(1),f(2),\ldots,f(n)$. For example, in the above array the values of the function are as follows: @@ -487,27 +487,23 @@ there are two possibilities how the subsequence that ends at position $k$ is constructed: \begin{enumerate} \item The subsequence -only contains the element $x_k$, so $f(k)=1$. -\item We choose some position $i$ for which $i