Longest Increasing Subsequence
L[0] = 0 for n = 1 to A.length L[n] = 1 for j = 1 to n-1 if A[j] < A[n] and L[n] < L[j] + 1 L[n] = L[j] + 1
L[0] =
0
L[n] =
1 + max{ L[j]: for all j < n such that A[j] < A[n] }