Given two sequences of length , write pseudocode of an -time algorithm to find a longest common subsequence. Note that a subsequence does not necessarily have to be contiguous. For example, if and , the sequence is a common (but not longest) subsequence of and .
Given a sequence of permuted integers from 1 to , write pseudocode of an -time algorithm to find the length of the longest monotonically increasing subsequence.