shortest path in matrix# JobHunting - 待字闺中
a*y
1 楼
You have a matrix of size n*n with entries either 1 or 0. 1 means there is a
path, 0 means no path. Find shortest path and print it from (0,0) to (n-1,
n-1)
这个我觉得用backtrack,但是keep那个path有点麻烦,假如你在某一点发现路径走的
cell数目相同,你怎么update那个path?任选一个?
path, 0 means no path. Find shortest path and print it from (0,0) to (n-1,
n-1)
这个我觉得用backtrack,但是keep那个path有点麻烦,假如你在某一点发现路径走的
cell数目相同,你怎么update那个path?任选一个?