What is the Big O time complexity of the standard schoolbook algorithm for multiplying two n x n matrices?
Show answer
O(n^3)
The naive multiplication algorithm requires n cubed multiplications because each of the n^2 elements in the resulting matrix is the dot product of two n-length vectors. More advanced algorithms, like Strassen's, can reduce this complexity.
Also asked as:
- What is the Big O complexity for multiplying two n x n matrices using the naive schoolbook method?