What will be the auxiliary space complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?

What will be the auxiliary space complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?
A. O(n log n)
B. O(n$^{2}$)
C. O(2$^{n}$)
D. O(sum*n)
 
Answer: d
Explanation: The auxiliary space complexity of set partition problem is required in order to store the partition table. It takes up a space of n*sum, so its auxiliary space requirement becomes O(n*sum).
 

Tìm kiếm

Back
Top