Hi,
Sorry for the small typo error...
Its not max, its min.
From above, a recurrent relation can be easily obtained:
>> For the first row, simply calculate S[i][j]=S[i][j]+S[i][j-1];
>> For the first col, simply calculate S[i][j] =S[i][j]+S[i-1][j];
>> For the rest of the matrix, calculate S[i][j] = min(S[i][j]+S[i-1][j], S[i][j]+S[i][j-1]);
- Thanks
Karthik
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups-beta.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---
- [algogeeks] Minimal path sum in a matrix (optimizing... [EMAIL PROTECTED]
- [algogeeks] Re: Minimal path sum in a matrix (o... aboyner
- [algogeeks] Re: Minimal path sum in a matri... [EMAIL PROTECTED]
- [algogeeks] Re: Minimal path sum in a m... Vijendra Singh
- [algogeeks] Re: Minimal path sum in a m... Lego Haryanto
- [algogeeks] Re: Minimal path sum in... Karthik Krishnamurthy
- [algogeeks] Re: Minimal path s... Karthik Krishnamurthy
- [algogeeks] Re: Minimal path sum in a matrix (o... KS
- [algogeeks] Re: Minimal path sum in a matri... [EMAIL PROTECTED]
- [algogeeks] Re: Minimal path sum in a matrix (o... [EMAIL PROTECTED]
