InterviewSolution
Saved Bookmarks
| 1. |
What is the time complexity of the brute force algorithm used to solve the Knapsack problem?(a) O(n)(b) O(n!)(c) O(2^n)(d) O(n^3)I had been asked this question in an interview for internship.My question is taken from 0/1 Knapsack Problem in section Dynamic Programming of Data Structures & Algorithms II |
|
Answer» Right option is (c) O(2^n) |
|