Last active
August 29, 2015 14:00
-
-
Save jitsceait/dd4d417720736cf6ce9c to your computer and use it in GitHub Desktop.
Code snippet for recursive solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int PossiblePaths(int i,int j, int m, int n){ | |
if(i > m || j > n) return 0; | |
if(i == m && j == n) return 1; | |
return PossiblePaths(i+1,j, m,n) | |
+ PossiblePaths(i, j+1, m,n) | |
+ PossiblePaths(i+1, j+1,m,n); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment