1.

Which of the following is a correct time complexity to solve the 0/1 knapsack problem where n and w represents the number of items and capacity of knapsack respectively?

A. O(n)
B. O(w)
C. O(nw)
D. O(n+w)
Answer» D. O(n+w)


Discussion

No Comment Found