A learning repository for mastering algorithms through multiple programming languages, with a focus on converting C++ solutions to Go and Rust.
This repository is designed as a systematic approach to learning Go and Rust by implementing the same LeetCode problems across three languages:
- C++ - Base implementations (reference solutions)
- Go - Learning functional programming patterns and Go idioms
- Rust - Learning memory safety, ownership, and systems programming concepts
leetcode-algo/
├── problem-name/
│ ├── cpp/
│ │ └── main.cpp # C++ reference solution
│ ├── golang/
│ │ └── main.go # Go implementation
│ └── rust/
│ ├── Cargo.toml # Rust project configuration
│ └── src/
│ └── main.rs # Rust implementation
├── .gitignore
├── LICENSE
└── README.md
- Start with C++ - Implement the algorithm in C++ as a reference
- Convert to Go - Focus on Go idioms, slices, maps, and concurrency patterns
- Convert to Rust - Learn ownership, borrowing, memory safety, and zero-cost abstractions
- C++: GCC or Clang compiler
- Go: Go 1.19+
- Rust: Rust 1.70+ (install via rustup)
cd problem-name/cpp
g++ -o main main.cpp
./main
cd problem-name/golang
go run main.go
cd problem-name/rust
cargo run
MIT License - see LICENSE file for details.
- LeetCode - Problem source
- Go Tour - Interactive Go tutorial
- Rust Book - The official Rust programming language book
- Go by Example - Hands-on Go examples
- Rust by Example - Learn Rust with examples