|
|
|
|
|
by roflmaostc
819 days ago
|
|
Two matrices with size NxN each can be multiplied naively with the schoolbook algorithm in O(N^3). It's clear that the algorithm needs at least O(N^2) because to access each element of the matrices once, you need a double for loop, which is O(N^2). for i in rows
for j in cols
# do something with element matrix1 [i, j], matrix2[i, j],...
so it has to be j >= 0 |
|