Java - Maximum sum in path through a 2D array

Viewed 20173

Basically I have a problem that goes something similar to this:

There is a garden of strawberry plants represented by a 2D, square array. Each plant(each element) has a number of strawberries. You start at the top left corner of the array, and you can only move to the right or down. I need to design a recursive method to calculate the paths through the garden and then output which one yields the most strawberries.

I think I have an understanding of really really simple recursion problems, but this problem has gone way over my head. I'm not really sure where to start or where to go as far as creating a recursive method.

Any help related to the code or helping me understand the concept behind this problem is greatly appreciated. Thanks.

3 Answers
Related