12 lines
526 B
Plaintext
12 lines
526 B
Plaintext
Calculate and show here a [[wp:Longest increasing subsequence|longest increasing subsequence]] of the list:
|
|
:<math>\{3, 2, 6, 4, 5, 1\}</math>
|
|
And of the list:
|
|
:<math>\{0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15\}</math>
|
|
|
|
Note that a list may have more than one subsequence that is of the maximum length.
|
|
|
|
;Ref:
|
|
# [http://www.youtube.com/watch?v=4fQJGoeW5VE Dynamic Programming #1: Longest Increasing Subsequence] on YouTube
|
|
# An efficient solution can be based on [[wp:Patience sorting|Patience sorting]].
|
|
<br><br>
|