Skip to content
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

SMWAK Algorithm Via Recursion #1582

Merged
merged 5 commits into from
Nov 4, 2024
Merged

Conversation

MithanshuHedau
Copy link
Contributor

@MithanshuHedau MithanshuHedau commented Nov 2, 2024

issue #1543

The SMAWK algorithm is an efficient method for finding row minima in totally monotone matrices, a specific type of matrix where entries decrease or stay constant along each row and column. Developed for optimizing complex search operations, this algorithm leverages a unique recursive approach, reducing computation time to O(m+n) for an m×n matrix, making it ideal for applications in computational geometry, dynamic programming, and machine learning. With SMAWK, developers gain a powerful tool for solving matrix-based problems more effectively, significantly improving the performance of algorithms that depend on finding minimum values in large, structured datasets

Time Complexity :

The SMAWK algorithm has a time complexity of O(m+n), where m is the number of rows and n is the number of columns in the matrix. This efficiency is achieved because the algorithm processes each row and column in a single pass, effectively discarding columns that do not contribute to the minima.

Space Complexity :

Regarding space complexity, SMAWK also requires O(m+n) additional space. This space is used for storing row and column indices, the reduced set of columns during processing, and result vectors that hold the minima for each row.

Overall, the efficient time and space complexities make the SMAWK algorithm particularly well-suited for working with large matrices that have a totally monotonic property, enabling quick and effective results while minimizing computational overhead.

@MithanshuHedau
Copy link
Contributor Author

@pankaj-bind , i Tried n number of times ,,but i dont know why i am getting this Test Deployment Error

@pankaj-bind pankaj-bind merged commit 8a08641 into AlgoGenesis:main Nov 4, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants