Skip to content

Commit d4a95a6

Browse files
committed
feat: Strassen's matrix multiplication algorithm added
1 parent 980a8b8 commit d4a95a6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

matrix/strassen_matrix_multiply.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
"""
2+
Strassen's Matrix Multiplication Algorithm
3+
------------------------------------------
4+
An optimized divide-and-conquer algorithm for matrix multiplication that
5+
reduces the number of multiplications from 8 (in the naive approach)
6+
to 7 per recursion step.
7+
8+
This results in a time complexity of approximately O(n^2.807),
9+
which is faster than the standard O(n^3) algorithm for large matrices.
10+
11+
Reference:
12+
https://en.wikipedia.org/wiki/Strassen_algorithm
13+
"""
14+
15+
116
from typing import List
217

318
Matrix = List[List[int]]

0 commit comments

Comments
 (0)