Skip to content

Instantly share code, notes, and snippets.

@pgrm
Created November 22, 2012 11:29
Show Gist options
  • Save pgrm/4130686 to your computer and use it in GitHub Desktop.
Save pgrm/4130686 to your computer and use it in GitHub Desktop.
AMPP - weired max
max=MAX3(diag,down,right);
if (max <= 0) {
h[i][j]=0;
xTraceback[i][j]=-1;
yTraceback[i][j]=-1;
// these values already -1
}
else if (max == diag) {
h[i][j]=diag;
xTraceback[i][j]=i-1;
yTraceback[i][j]=j-1;
}
else if (max == down) {
h[i][j]=down;0
xTraceback[i][j]=i-1;
yTraceback[i][j]=j;
}
else {
h[i][j]=right;
xTraceback[i][j]=i;
yTraceback[i][j]=j-1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment