Skip to main content

rs_avl/
lib.rs

1//! A generic AVL ordered set with logarithmic search and updates.
2//!
3//! [`AVLTree`] stores unique ordered values and provides insertion, removal,
4//! borrowed-key search, lazy traversals, and bounded range iteration. Tree
5//! height is maintained automatically through AVL rotations.
6//!
7//! # Example
8//!
9//! ```
10//! use rs_avl::AVLTree;
11//!
12//! let mut tree = AVLTree::new();
13//! tree.extend([4, 2, 6, 1, 3, 5, 7]);
14//!
15//! assert!(tree.contains(&5));
16//! assert_eq!(tree.range(2..=5).copied().collect::<Vec<_>>(), [2, 3, 4, 5]);
17//! assert!(tree.remove(&4));
18//! ```
19
20pub mod avl;
21mod python;
22mod python_tree;
23
24pub use avl::{AVLNode, AVLTree};