InterviewSolution
Saved Bookmarks
| 1. |
Which of the following is true about the time complexity of the recursive solution of the subset sum problem?(a) It has an exponential time complexity(b) It has a linear time complexity(c) It has a logarithmic time complexity(d) it has a time complexity of O(n2) |
|
Answer» Correct option is (a) It has an exponential time complexity Easiest explanation - Subset sum problem has both recursive as well as dynamic programming solution. The recursive solution has an exponential time complexity as it will require to check for all subsets in worst case. |
|