McqMate

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

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- Recursive solution of subset sum problem is faster than dynamic problem solution in terms of time complexity.
- Recursive solution of Set partition problem is faster than dynamic problem solution in terms of time complexity.
- Which of the following is true about the time complexity of the recursive solution of set partition problem?
- What is the worst case time complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?
- You are given infinite coins of N denominations v1, v2, v3,…..,vn and a sum S. The coin change problem is to find the minimum number of coins required to get the sum S. What is the time complexity of a dynamic programming implementation used to solve the coin change problem?
- What will be the auxiliary space complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?
- Subset sum problem is an example of NP- complete problem.
- Which of the following is not true about subset sum problem?
- How many recursive calls are there in Recursive matrix multiplication by Strassen’s Method?
- What is the time complexity of the above recursive implementation used to reverse a string?