Which of the following is not true about subset sum problem?

Which of the following is not true about subset sum problem?
A. the recursive solution has a time complexity of O(2n)
B. there is no known solution that takes polynomial time
C. the recursive solution is slower than dynamic programming solution
D. the dynamic programming solution has a time complexity of O(n log n)
 
Answer: d
Explanation: Recursive solution of subset sum problem is slower than dynamic problem solution in terms of time complexity. Dynamic programming solution has a time complexity of O(n*sum).
 

Tìm kiếm

Back
Top