docs: add complexity notes to Strassen algorithm - #14085
Conversation
|
def partition(arr: list, low: int, high: int) -> int: def kth_largest_element(arr: list, position: int) -> int: you should try this one |
|
ill commit again to resolve the test conflicts |
Updated examples in the strassen function to improve readability and clarity.
for more information, see https://pre-commit.ci
|
But my system it execute |
There was a problem hiding this comment.
Pull request overview
Updates documentation for the Strassen matrix multiplication implementation by adding complexity notes and restructuring docstrings to better explain algorithmic tradeoffs.
Changes:
- Added asymptotic complexity notes to
actual_strassen()docstring. - Rewrote the
strassen()docstring to include an intro, examples, and complexity notes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """ | ||
| >>> 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]]) | ||
| [[34, 23, 19, 15], [68, 46, 37, 28], [28, 18, 15, 12], [96, 62, 55, 48]] | ||
| >>> strassen([[3,7,5,6,9],[1,5,3,7,8],[1,4,4,5,7]], [[2,4],[5,2],[1,7],[5,5],[7,8]]) | ||
| [[139, 163], [121, 134], [100, 121]] | ||
| Perform matrix multiplication using Strassen’s algorithm. | ||
|
|
||
| Examples: | ||
| >>> 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]]) |
Describe your change:
improved the docstrings with complexity notes,
Checklist: