Skip to content

Instantly share code, notes, and snippets.

@kelchm
Created April 29, 2013 15:42
Show Gist options
  • Save kelchm/5482460 to your computer and use it in GitHub Desktop.
Save kelchm/5482460 to your computer and use it in GitHub Desktop.
F = new int[n][w];
// Initialize first row and first column to zero
for(int i = 0; i<n; i++)
{
F[i][0] = 0;
}
for(int i = 0; i<w; i++)
{
F[0][i] = 0;
}
// Initialize remaining locations to -1
for(int i = 1; i<n; i++)
{
for(int j = 1; j<w; j++)
{
F[i][j] = -1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment