-
-
Notifications
You must be signed in to change notification settings - Fork 157
Adding solution of strassen algorithm. #3643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
## Fixing Issue codeharborhub#3624 ## Description This pull request adds the implementation of Strassen's algorithm in C++ to the DSA folder. Strassen's algorithm is an efficient algorithm for matrix multiplication that is faster than the conventional matrix multiplication algorithm. It reduces the time complexity from O(n^3) to approximately O(n^2.81), making it suitable for large matrices. ## Type of PR - [ ] Bug fix - [x] Feature enhancement - [ ] Documentation update - [ ] Security enhancement - [ ] Other (specify): _______________ ## Checklist - [x] I have performed a self-review of my code. - [x] I have read and followed the Contribution Guidelines. - [x] I have tested the changes thoroughly before submitting this pull request. - [x] I have provided relevant issue numbers, screenshots, and videos after making the changes. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have followed the code style guidelines of this project. - [x] I have checked for any existing open issues that my pull request may address. - [x] I have ensured that my changes do not break any existing functionality. - [x] Each contributor is allowed to create a maximum of 4 issues per day. This helps us manage and address issues efficiently. - [x] I have read the resources for guidance listed below. - [x] I have followed security best practices in my code changes. ## Additional Context Strassen's algorithm implementation includes: - Efficient matrix multiplication using a divide-and-conquer approach. - Reduction in time complexity compared to the conventional algorithm. - Clear and well-commented code for easy understanding and maintenance. ## Resources for Guidance Please read the following resources before submitting your contribution: - [x] [Code Harbor Hub Community Features](https://www.codeharborhub.live/community/features) - [x] [Markdown Guide](https://www.markdownguide.org/)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job, @sjain1909! 🎉 Thank you for submitting your pull request to CodeHarborHub. We appreciate your contribution and enthusiasm! Our team will review it soon. If you have any questions or need further assistance, feel free to reach out. Thanks for contributing!
Here's the code health analysis summary for commits Analysis Summary
|
@ajay-dhangar sir, kindly review and let me know if any changes required. |
⚡️ Lighthouse Report for the Deploy Preview of this PR 🚀🔗 Site: CodeHarborHub | Live Site
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update your code based on suggestions
|
||
### Complexity Analysis | ||
|
||
- **Time Complexity:** \(O(n^{\log_2 7}) \approx O(n^{2.81})\) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace\(O(n^{\log_2 7}) \approx O(n^{2.81})\)
with $O(n^{\log_2 7}) \approx O(n^{2.81})$
### Complexity Analysis | ||
|
||
- **Time Complexity:** \(O(n^{\log_2 7}) \approx O(n^{2.81})\) | ||
- **Space Complexity:** \(O(n^2)\) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace \(O(n^2)\)
to $O(n^2)$
- **Time Complexity:** \(O(n^{\log_2 7}) \approx O(n^{2.81})\) | ||
- **Space Complexity:** \(O(n^2)\) | ||
|
||
The time complexity is significantly reduced compared to the traditional \(O(n^3)\) matrix multiplication. The space complexity is determined by the storage requirements of the matrices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace \(O(n^3)\)
with $O(n^3)$
@ajay-dhangar please close this request as done via #3671. |
Fixing Issue
Fix #3624
Description
This pull request adds the implementation of Strassen's algorithm in C++ to the DSA folder. Strassen's algorithm is an efficient algorithm for matrix multiplication that is faster than the conventional matrix multiplication algorithm. It reduces the time complexity from O(n^3) to approximately O(n^2.81), making it suitable for large matrices.
Type of PR
Checklist
Additional Context
Strassen's algorithm implementation includes:
Resources for Guidance
Please read the following resources before submitting your contribution: