Q.

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» A. it has an exponential time complexity
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.
1.6k
0
Do you find this helpful?
2

Discussion

No comments yet