@@ -113,23 +113,23 @@ def actual_strassen(matrix_a: list, matrix_b: list) -> list:
113113
114114def strassen (matrix1 : list , matrix2 : list ) -> list :
115115 """
116- Perform matrix multiplication using Strassen’s algorithm.
116+ Perform matrix multiplication using Strassen’s algorithm.
117117
118- Examples:
119- >>> strassen([[2,1,3],[3,4,6],[1,4,2],[7,6,7]], [[4,2,3,4],[2,1,1,1],[8,6,4,2]])
120- [[34, 23, 19, 15], [68, 46, 37, 28], [28, 18, 15, 12], [96, 62, 55, 48]]
118+ Examples:
119+ >>> strassen([[2,1,3],[3,4,6],[1,4,2],[7,6,7]], [[4,2,3,4],[2,1,1,1],[8,6,4,2]])
120+ [[34, 23, 19, 15], [68, 46, 37, 28], [28, 18, 15, 12], [96, 62, 55, 48]]
121121
122- >>> strassen(
123- ... [[3,7,5,6,9],[1,5,3,7,8],[1,4,4,5,7]],
124- ... [[2,4],[5,2],[1,7],[5,5],[7,8]]
125- ... )
122+ >>> strassen(
123+ ... [[3,7,5,6,9],[1,5,3,7,8],[1,4,4,5,7]],
124+ ... [[2,4],[5,2],[1,7],[5,5],[7,8]]
125+ ... )
126126
127127
128- Complexity Notes:
129- - Classical matrix multiplication: O(n^3).
130- - Strassen's algorithm: O(n^(log2(7))) ≈ O(n^2.81).
131- - Strassen reduces the number of multiplications from 8 to 7 per recursion,
132- trading them for additional additions/subtractions.
128+ Complexity Notes:
129+ - Classical matrix multiplication: O(n^3).
130+ - Strassen's algorithm: O(n^(log2(7))) ≈ O(n^2.81).
131+ - Strassen reduces the number of multiplications from 8 to 7 per recursion,
132+ trading them for additional additions/subtractions.
133133 """
134134 if matrix_dimensions (matrix1 )[1 ] != matrix_dimensions (matrix2 )[0 ]:
135135 msg = (
0 commit comments