1.

For any given sequence, there will ALWAYS be a unique increasing subsequence with the longest length.(a) True(b) FalseI have been asked this question in a job interview.The question is from Longest Increasing Subsequence in portion Dynamic Programming of Data Structures & Algorithms II

Answer»

Correct option is (b) False

To explain: For a GIVEN SEQUENCE, it is POSSIBLE that there is more than one subsequence with the longest length.

Consider, the following sequence: {10,11,12,1,2,3}:

There are two longest increasing subsequences: {1,2,3} and {10,11,12}.



Discussion

No Comment Found

Related InterviewSolutions