Recursion

Ugh, never mind I got it. I was completely off.
Last edited on
1
2
det = matrix(1,1)*matrix(2,2)-matrix(1,2)*matrix(2,1); //this shouldn't compile
submatrix[rows][columns] = matrix[j][k]; //this is how you obtain a cell 

Also, index goes from 0 to n-1
Last edited on
My bad, that was a typo. I'll fix it right now. Also, I should have mentioned this but earlier in the code I recorded the matrices starting at [1][1] as that made it easier to follow along with the Professor's instructions.
I think the loops need to go to size then
1
2
3
4
for(int i=1; i<=size; i++)
//and
if(columns == size)
   rows++;
Topic archived. No new replies allowed.