Skip to content

docs: Add detailed docstrings explaining Strassen algorithm complexity#14350

Open
hiSandog wants to merge 1 commit intoTheAlgorithms:masterfrom
hiSandog:master
Open

docs: Add detailed docstrings explaining Strassen algorithm complexity#14350
hiSandog wants to merge 1 commit intoTheAlgorithms:masterfrom
hiSandog:master

Conversation

@hiSandog
Copy link

@hiSandog hiSandog commented Mar 8, 2026

Description

Adds comprehensive documentation to the Strassen matrix multiplication algorithm explaining its time and space complexity.

Changes Made

  • Added detailed docstring to strassen() function explaining:

    • Time complexity: O(n^2.807) vs O(n³) for standard multiplication
    • Space complexity: O(n²)
    • The 7 matrix multiplication formulas (P1-P7)
    • When the algorithm is beneficial (large matrices)
    • Input requirements (dimensions must be power of 2)
  • Improved docstring for actual_strassen() with proper Args, Returns, and Raises sections

Related Issue

Addresses issue #14084: adding better docstring explaining Strassen's complexity

Checklist

  • Added docstrings with proper formatting
  • Existing doctests pass
  • Documentation is clear and comprehensive

- Added comprehensive docstring to strassen() function explaining:
  - Time complexity: O(n^2.807) vs O(n³) for standard multiplication
  - Space complexity: O(n²)
  - The 7 matrix multiplication formulas used
  - When the algorithm is beneficial (large matrices)
  - Input requirements (dimensions must be power of 2)

- Improved docstring for actual_strassen() with args and raises documentation

- Addresses issue TheAlgorithms#14084: adding better docstring explaining Strassen's complexity
@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant