-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
added a plus-minus-one range minimum query data structure #694
base: master
Are you sure you want to change the base?
Conversation
This reverts commit 195f257.
note the small change made to range_minimum_query.rs |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #694 +/- ##
==========================================
- Coverage 95.05% 94.98% -0.08%
==========================================
Files 306 307 +1
Lines 22733 22877 +144
==========================================
+ Hits 21609 21729 +120
- Misses 1124 1148 +24 ☔ View full report in Codecov by Sentry. |
This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@Miraksi could you please provide me with more details? By the way, do you see some change for some common interface for |
For +-1 RMQ we assume that two consecutiv entries in a given list differ by exactly one. This enables us to use clever bit operations to enhance the runtime complexity of range minimum queries on this list. I would love to see this data structure added, as it will lead to an optimal (from a time complexity point) Lowest Common Ancestor runtime. This in turn can be extended to an optimal RMQ implementation, having a construction time of O(n) and a query time of O(1) |
I'm not sure as to what you mean by common interface. Since |
Plus-Minus-One RangeMinimumQuery in Rust
Description
A data structure that can answer range minimum queries for arrays, where two consecutive entries differ by exactly one. This implementation achieves an O(n) build time and a O(1) query time for n being the length of the input array. The relevancy of this data structure is given by the combination with Cartesian trees, which leads to an implementation of the general range minimum query in O(n) build time and O(1) query time.
New feature
Checklist:
cargo clippy --all -- -D warnings
just before my last commit and fixed any issue that was found.cargo fmt
just before my last commit.cargo test
just before my last commit and all tests passed.mod.rs
file within its own folder, and in any parent folder(s).DIRECTORY.md
with the correct link.COUNTRIBUTING.md
and my code follows its guidelines.