I have this question about why the big O for this equation is n cube ?
else if(key == 'x')
C = matrixMult(A, B);
Thanks very much
I have this question about why the big O for this equation is n cube ?
else if(key == 'x')
C = matrixMult(A, B);
Thanks very much
The resulting matrix has n^2 entries. The computation of each entry can be done by a sum of n products, yielding n^3.
This is only valid for the textbook algorithm, as there exist faster algorithms, e.g. Strassen's algorithm or the fastest known algorithm.