-
Notifications
You must be signed in to change notification settings - Fork 20k
Added Maximum Sliding Window algorithm using deque for efficient O(n) solution. #5848
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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5848 +/- ##
============================================
+ Coverage 72.32% 72.34% +0.01%
- Complexity 4965 4975 +10
============================================
Files 651 652 +1
Lines 17562 17576 +14
Branches 3385 3389 +4
============================================
+ Hits 12702 12715 +13
Misses 4382 4382
- Partials 478 479 +1 ☔ View full report in Codecov by Sentry. |
Pull Request Description Overview: This pull request adds an implementation of the Maximum Sliding Window algorithm using a deque (double-ended queue) for efficient O(n) time complexity. The algorithm allows you to find the maximum value in every sliding window of size k in an array of integers. Key Features: Efficient Implementation: Utilizes a deque to maintain the indices of useful elements in the current window, allowing for optimal performance. Feedback: I welcome any feedback or suggestions for improvements on this implementation. |
src/main/java/com/thealgorithms/others/MaximumSlidingWindow.java
Outdated
Show resolved
Hide resolved
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.
Looks good, thanks!
clang-format -i --style=file path/to/your/file.java