rand_set
A high-performance hash set implementation with O(1) random element access and all standard set operations.
Features
- O(1) Random Access: Get random elements from the set in constant time
- Standard Set Operations: All the operations you expect from a hash set
- Memory Efficient: Optimized internal representation
Quick Start
Add this to your Cargo.toml:
[]
= "0.1"
Usage
use RandSet;
let mut set = new;
set.insert;
set.insert;
// Fast containment check (works like HashSet)
assert!;
// Unique feature: Get a random element in O(1)
if let Some = set.get_rand
License
This project is licensed under the MIT License - see the LICENSE file for details.