| Crates.io | dsa_abc |
| lib.rs | dsa_abc |
| version | 0.1.4 |
| created_at | 2025-04-22 05:04:28.06181+00 |
| updated_at | 2025-04-22 18:31:59.696591+00 |
| description | Implementation of basic data structure and algorithms. Usability and performance is priority |
| homepage | https://github.com/lucasmelodev1/dsa_abc |
| repository | https://github.com/lucasmelodev1/dsa_abc |
| max_upload_size | |
| id | 1643637 |
| size | 31,050 |
A collection of core Data Structures and Algorithms implemented in Rust. Currently includes a fully functional and tested Binary Search Tree (BST) with support for insert, delete, search, and traversal operations.
Clone this repository and include it in your workspace or build it as a Rust library:
git clone https://github.com/lucasmelodev1/dsa_abc cd dsa_abc cargo build
use dsa_abc::BinarySearchTree;
fn main() {
let mut bst = BinarySearchTree::new(10);
bst.add(5);
bst.add(15);
if let Some(val) = bst.get(&5) {
println!("Found: {}", val);
}
// Traversal example
let mut values = vec![];
bst.in_order(&mut |v| values.push(*v));
println!("In-order values: {:?}", values);
}
Run tests using:
cargo test
Tests include:
src/
โโโ lib.rs # Core implementation
โโโ ...
This crate aims to be an educational toolkit for practicing and learning DSA in Rust. Upcoming additions include:
This library uses unsafe code to manually manage pointers for educational purposes. Check the tests section to see if they are enough for your use case and, if not enough, please contact me and I will update them.
MIT License