Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Why allocate array with [0, capacity] and not [1,capacity] in 0/1 Knapsack?

agustin.vaca

Jun 7, 2023

I understand we need to store values for when capacity = original capacity, but we're not storing anything for capacity = 0. Why not allocate [1,capacity] for the dp array?

0

0

Comments
Comments

On this page