Code covered by the BSD License
16 Oct 2013
max path using dynamic programming
Watch this File
Min path can be found by setting II = -II.
Does not use nested for-loops, but for-loops can't be completely avoided due to the nature of the problem
Returned value is the linearly indexed array of the locations of the max path. This can be altered to give the coordinates as directed in the function.
Weights are assumed to be 1, but can be changed as directed in the function.