The longest increasing (contiguous) subsequence of a given sequence is the subsequence of increasing terms containing the largest number of elements. For example, the longest
increasing subsequence of the
permutation is .
It can be coded in the
Split[Sort[Runs[p]], Length[#1] >= Length[#2]&]
See also Longest Increasing
Explore with Wolfram|Alpha
References Pemmaraju, S. and Skiena, S. "Longest Increasing Subsequences." §4.4.6 in Cambridge,
England: Cambridge University Press, pp. 170-172, 2003. Computational
Discrete Mathematics: Combinatorics and Graph Theory in Mathematica. Skiena,
S. "Longest Increasing Subsequences." §2.3.6 in Reading,
MA: Addison-Wesley, pp. 73-75, 1990. Implementing
Discrete Mathematics: Combinatorics and Graph Theory with Mathematica. Referenced on Wolfram|Alpha Longest Increasing Subsequence
Cite this as:
Weisstein, Eric W. "Longest Increasing Subsequence."
From --A Wolfram Web Resource. MathWorld https://mathworld.wolfram.com/LongestIncreasingSubsequence.html