-4

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

4

1 回答 1

0

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.

于 2013-03-30T12:09:51.190 回答