InterviewSolution
Saved Bookmarks
| 1. |
In the brute force implementation to find the longest increasing subsequence, all the subsequences of a given sequence are found. All the increasing subsequences are then selected and the length of the longest subsequence is found. What is the time complexity of this brute force implementation?(a) O(n)(b) O(n^2)(c) O(n!)(d) O(2^n)This question was posed to me in semester exam.My question comes from Longest Increasing Subsequence in division Dynamic Programming of Data Structures & Algorithms II |
|
Answer» The correct option is (d) O(2^N) |
|