dsa_abc 0.1.0

Implementation of basic data structure and algorithms. Usability and performance is priority
Documentation

#๐Ÿ“š Rust DSA Library

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. ##๐Ÿš€ Features

โœ… Binary Search Tree (BST)

    Insert

    Delete

    Search

    In-order, Pre-order, Post-order traversals

๐Ÿ“ˆ Logarithmic time complexity for insert/search/delete in balanced trees

๐Ÿงช Thoroughly tested with unit tests

๐Ÿฆ€ Unsafe Rust for raw pointer manipulation (educational use-case)

##๐Ÿ“ฆ Installation

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

##๐Ÿ“˜ Usage Example

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);

}

##โœ… Tests

Run tests using:

cargo test

Tests include:

Basic insert/search/delete

Deleting root and internal nodes

Verifying correct order in traversals (in-order, pre-order, post-order)

##๐Ÿ“‚ Structure

src/ โ”œโ”€โ”€ lib.rs # Core BinarySearchTree implementation โ””โ”€โ”€ ...

##๐Ÿ”ง Planned Features

This crate aims to be an educational toolkit for practicing and learning DSA in Rust. Upcoming additions include:

โœ… Binary Search Tree

โณ AVL Tree

โณ Red-Black Tree

โณ Hash Table

โณ Linked List

โณ Sorting Algorithms (Merge, Quick, Bubble)

โณ Heap

##โš ๏ธ Safety Disclaimer

This library uses unsafe code to manually manage pointers for educational purposes. While useful for learning low-level memory management, it should be handled with care in production systems. ##๐Ÿ“„ License

MIT License