Re: [algogeeks] Re: Shortest path in grid with dynamic programming.

2014-05-20 Thread Don
BFS might be faster, though. Don On Tuesday, April 22, 2014 1:11:00 AM UTC-4, bujji wrote: > > Hi Don, > At most we can reach a point from 4 adjacent points. So, > time complexity will be O(XY) only. > > -Thanks, > Bujji. > > > On Mon, Apr 21, 2014 at 1:38 PM, bujji jajala > > wrot

Re: [algogeeks] Re: Shortest path in grid with dynamic programming.

2014-04-22 Thread Don
Good catch. A function called "markShortestPath" ought to mark the shortest path, huh? Don On Monday, April 21, 2014 4:38:32 PM UTC-4, bujji wrote: > > > Nice solution. good. Looks like in your markShortestPath(int > i, int i, int d) function > you missed to set distance[i][j

Re: [algogeeks] Re: Shortest path in grid with dynamic programming.

2014-04-21 Thread bujji jajala
Hi Don, At most we can reach a point from 4 adjacent points. So, time complexity will be O(XY) only. -Thanks, Bujji. On Mon, Apr 21, 2014 at 1:38 PM, bujji jajala wrote: > Hi Don, > Nice solution. good. Looks like in your markShortestPath(int > i, int i, int d) f

Re: [algogeeks] Re: Shortest path in grid with dynamic programming.

2014-04-21 Thread bujji jajala
Hi Don, Nice solution. good. Looks like in your markShortestPath(int i, int i, int d) function you missed to set distance[i][j] = d; as first statement. It looks like time complexity of this program is greater than O(XY). It depends on number of multiple paths to a point with dif