Skip to content

Commit ec8e7c9

Browse files
authored
Fix grammar in docstrings and comments
Corrected minor grammatical issues in docstrings and comments.
1 parent 1ba4849 commit ec8e7c9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

divide_and_conquer/strassen_matrix_multiplication.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"""
2+
https://en.wikipedia.org/wiki/Strassen_algorithm
3+
"""
14
from __future__ import annotations
25

36
import math
@@ -32,7 +35,7 @@ def matrix_subtraction(matrix_a: list, matrix_b: list):
3235

3336
def split_matrix(a: list) -> tuple[list, list, list, list]:
3437
"""
35-
Given an even length matrix, returns the top_left, top_right, bot_left, bot_right
38+
Given an even-length matrix, returns the top_left, top_right, bot_left, bot_right
3639
quadrant.
3740
3841
>>> split_matrix([[4,3,2,4],[2,3,1,1],[6,5,4,3],[8,4,1,6]])
@@ -80,7 +83,7 @@ def actual_strassen(matrix_a: list, matrix_b: list) -> list:
8083
multiply two n x n matrices from the 8 required by the naive divide-and-conquer
8184
approach down to 7, at the cost of a few extra matrix additions/subtractions
8285
(which are cheaper, O(n^2), operations). Each matrix is split into four
83-
(n/2) x (n/2) quadrants, 7 products of quadrant combinations are computed
86+
(n/2) x (n/2) quadrants; 7 products of quadrant combinations are computed
8487
recursively, and those products are combined with additions/subtractions to
8588
form the four quadrants of the result.
8689

0 commit comments

Comments
 (0)