i have an assignment,and i need help!! in a given 2D ARRAY of integers and a given MAXIMUM number of steps the program supposed to find a path, from one corner to the one in front of it, which sums the biggest numbers in limited number of steps. this supposed to be done with BACKTRACKING RECURTION...
A:
Try to think about breath-first search approach. Will allow you to optimize by cutting-off branches that isn't optimal in advance (i.e. one cell on next layer accessible by two branches - you save only the shortest one)
ony
2010-06-26 17:53:08