Loading...
Interactively observe computation of M1..M7 and how they recombine to form the result matrix.
| 3 | -3 |
| 1 | -3 |
| 0 | -3 |
| -4 | 2 |
1function strassen(A, B):2 if n == 1: return A*B3 partition A,B into 4 submatrices4 compute 7 products P1..P75 combine into result matrix C6 return CEight naive sub-matrix multiplications become seven via pre-combined sums/differences forming M1..M7; additional additions/subtractions are offset for large n. This visualization limits recursion depth for clarity (4x4 performs one split then 2x2 base).