pull/999/head
Santanu Jana 2022-10-09 12:26:25 +05:30
parent 75f0b66e63
commit 2d86df57a2
2 changed files with 10 additions and 2 deletions

View File

@ -34,4 +34,8 @@ int main() {
int m = matrix[0].size(); int m = matrix[0].size();
cout<<minSumPath(n,m,matrix); cout<<minSumPath(n,m,matrix);
} }
// Time Complexity: O(N*M)
// Space Complexity: O((M-1)+(N-1)) + O(N*M)
// example : N=2,M=3
// Min pathsum = 5+9+6+2 =21

View File

@ -43,4 +43,8 @@ int main() {
int n=2; int n=2;
cout<<countWays(m,n); cout<<countWays(m,n);
} }
// Time Complexity: O(M*N)
// Space Complexity: O(M*N)
// example : M=3,N=2
// Unique paths = 3