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

Add Range Query Support to HyperTree #302

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

oselezi
Copy link

@oselezi oselezi commented Nov 29, 2024

This PR introduces range query functionality to the HyperTree, allowing efficient retrieval of values within a specified range. Key changes:

  1. RedBlackTreeRangeIterator (in red_black_tree.rs):

    • Iterates through tree nodes within a given range.
    • Handles inclusive and exclusive ranges.
  2. range Method Integration:

    • Added to HyperTreeReadOperations in hypertree.rs.
    • Uses RedBlackTreeRangeIterator to fetch values between min and max.
  3. Tests:

    • Comprehensive unit tests added in red_black_tree.rs and hypertree.rs.

Modified Files:

  • red_black_tree.rs: Adds RedBlackTreeRangeIterator and range query logic.
  • hypertree.rs: Integrates range query into HyperTreeReadOperations.

Example Usage:

let range_iter = tree.range(&100, &300);
for value in range_iter {
    println!("{:?}", value);
}
// Output: Values between 100 and 300

Checklist:

  • Code compiles without errors.
  • Unit tests cover the new functionality.
  • Verified backward compatibility.

Looking forward to feedback and suggestions!

@oselezi oselezi marked this pull request as ready for review December 5, 2024 16:26
@brittcyr
Copy link
Contributor

brittcyr commented Dec 6, 2024

The compilation issues in the tests action look real, but if it all works on your machine, I can investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants