I was reading dynamic programming problem, 0/1 knapsack at https://www.educative.io/courses/grokking-dynamic-programming-patterns-for-coding-interviews/RM1BDv71V60
Upon reading, Question I have is, which is a general question,
If I straightaway want to jump to a bottom-up approach, how do we finalize the storage grid size to start within a bottom-up approach? I mean in the given example of the link, recursive/brute force solutions have two variables changing. That is why I believe, that 2D grid size come into the picture and from there I reached top-down and then bottom up. How would you think of the dimensions of the storage grid if I want to jump to bottom-up approach directly.
And how do we decide which dimension represents what?
It would be excellent if someone can shed light on it. I would be happy to add more details if needed.
question from:
https://stackoverflow.com/questions/65914351/dynamic-programming-evaluating-grid-size 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…