Data Structures & AlgorithmsVery hardGATE CS · ICPC regional

What is the length of the longest strictly increasing subsequence (not necessarily contiguous) of [3, 9, 11, 8, 12, 13, 1, 14, 5, 7, 4, 10, 2, 6]?

  1. A. 3
  2. B. 5
  3. C. 6
  4. D. 8

Correct answer: C. 6

Patience sorting maintains the smallest possible tail of each length; the answer is the number of piles. The longest decreasing subsequence, or the longest contiguous increasing run, is a different quantity.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic