Dynamic Programming tips plz?

Jul 10, 2019 at 8:58am
Hello everyone, I am a beginner in c++ programming. I was learning data structures & algorithms and came across the knapsack problem, optimal merge pattern, traveling salesman problem, etc. Although I understood how they work, I am facing a little problem while trying to implement them in C++. Can someone suggest to me how I can improve so that I can solve various implementations of these algorithms? Thanks in advance :)
Last edited on Jul 10, 2019 at 8:58am
Jul 10, 2019 at 2:18pm
As a beginner, I think you should steer away from the knapsack problem, AKA traveling salesman problem, These problems are "NP complete" which means that finding an optimal solution is takes absurdly huge amounts of time for reasonably large problems (think "longer than the universe has existed").

Try some easier problems first to get a feel for programming. Once you're fluent, you can try tackling these harder problems.
Jul 11, 2019 at 6:59pm
okay, thank you! :)
Topic archived. No new replies allowed.