This repository contains Rust implementations of classic computer science algorithms, providing efficient and well-documented solutions to fundamental problems.
Solves the N-Queens problem using backtracking to find all possible arrangements of N queens on an N×N chessboard.
Features:
- Finds all valid solutions
- Interactive solution navigation
- Visual board representation
Implements the Huffman compression algorithm for lossless text encoding.
Features:
- Character frequency analysis
- Optimal prefix-free code generation
- Binary encoding output
- Rust 1.70 or higher
- Cargo (comes with Rust)
Clone the repository:
git clone https://github.com/naseridev/algorithm-design.gitcd algorithm-designBuild all projects:
cargo build --releasecd n-queens-solver
cargo run --releaseFollow the on-screen prompts to navigate through solutions.
cd huffman-coding
cargo run --releaseEnter text when prompted to see the Huffman encoding.
- clearscreen: Terminal clearing utility
- No external dependencies (uses std library only)
Each algorithm has its own detailed README in its respective directory:
Contributions are welcome! Please feel free to submit pull requests or open issues.