hi Kevin,
Kevin Mckeon wrote:I have one question, does your method and hint above use the method of Memoization or Tabulation when finding the optimal solution. Is it possible to use both methods and still get a solution ?
Memoization vs Tabulation
Well I didn't know these terms when it comes to DP, but your link is very clear about that (GeeksForGeeks is an excellent site for all kinds of algorithms, I've used it often myself).
I always use the Bottom Up approach, but it is certainly possible to do the Top Down way. I don't think it is more difficult, but as said I have never used it that way. Maybe if you have come up with a solution, that we discuss how to do it the other way?
One possible problem with the top down is that a recursion may lead to a StackOverflow, which happened to me lately. I was given an N-nary Tree (a Tree where each Node can have 0 to N nodes). Each Node had a value that was the sum of its autonomous value and the sum of all its Nodes underneath. Now, I had this implemented recursively, so all I needed was: topnode.getValue(), but of course that Tree I was given contained 100.000 Nodes, completely sequentiial. So I had to think of something else.