Question: [C++] Please find the Time Complexity of this for loop, and explain how you got the answer: //matrix multiplication of A[m][n] and B[n][p]. The product
[C++] Please find the Time Complexity of this for loop, and explain how you got the answer:
//matrix multiplication of A[m][n] and B[n][p]. The product is saved into C[m][p].
void mult_matricies( double A[][n], double B[][p], double C[][p], int m, int n , int p ){
for (int i=0; i for (int j=0; j C[i][j] = 0; for ( int k=0; k C[i][j] += A[i][k] * B[k][j]; }//for-k }//for-j }//for-i }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
