Skip to content

Instantly share code, notes, and snippets.

@zmallen
Created March 9, 2015 20:41
Show Gist options
  • Save zmallen/89f3d26f72ed1e6b5700 to your computer and use it in GitHub Desktop.
Save zmallen/89f3d26f72ed1e6b5700 to your computer and use it in GitHub Desktop.
private int determinant(int row, int col, int size) {
int sum = 0;
if(size == 1) {
return this.data[0][0];
}
else if (size == 2) {
return (this.data[row][col] * this.data[row+1][col+1]) - (this.data[row][col+1] * this.data[row+1][col]);
} else {
return determinant(row+1,col+1,size);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment