Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
90 views
in Technique[技术] by (71.8m points)

c++ - Dynamic programming - Evaluating grid size

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...