No. of paths =(n+m-2)C(n-1) Total number of times u have to change the column is m-1 and row is n-1 thus u have total (n-1+m-1) operations to do and out of these operations u have to choose n-1 operation for changing rows. ok..... On Thu, Feb 21, 2013 at 2:29 PM, Karthikeyan V.B <[email protected]>wrote:
> Assuming that u can either move down or right, > > Using Dynamic Programming, > > a DP equation can be framed like this : Paths[i][j] = paths[i][j-1] + > paths[i-1][j] > By filling the entire matrix, result will be in Paths[m-1][n-1]. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
