Using recursion to find paths in a 2D array
- by rikkit
Hi, I'm working on a project for my A level. It involves finding the maximum flow of a network, and I'm using javascript.
I have a 2D array, with values in the array representing a distance between the two points. An example of the array:
0 2 2 0
0 0 1 2
0 0 0 2
0 0 0 0
I think I need to use a recursive technique to find a path; below is some…