A multi-language learning companion to TheAlgorithms/Python. Compare, Implement, and Learn.
Important
This is a specialized fork. While the original TheAlgorithms/Python repository collects algorithms implemented in Python, this repository is dedicated to converting those algorithms into other languages (C++, JS, Rust, Go) side-by-side and generating interactive exercises to help you learn them.
This repository is an experiment in Side-by-Side Learning. We take classic algorithms (originally in Python) and:
- Convert them into C++, JavaScript, Rust, and Go.
- Generate "Fill in the Blanks" learning exercises for each.
- Supervise your learning using a Local LLM (Ollama) that runs entirely on your machine.
For each algorithm (e.g., Bubble Sort), you will find:
- Original:
sorts/bubble_sort.py - Translations:
sorts/bubble_sort.cppsorts/bubble_sort.jssorts/bubble_sort.rssorts/bubble_sort.go
- Learning:
_learn/bubble_sort/containing exercises with missing logic for you to complete.
This project includes a local AI tutor script: scripts/supervisor.py.
- What it does: It reads your code (e.g., your attempt at
_learn/bubble_sort/cpp_exercise.cpp), sends it to your local Ollama instance (e.g., LLaMA 3.2), and generates:- A Rating (1-10)
- Key Concepts/Tags
- A Quiz Question
- Privacy: Your code never leaves your machine.
- Usage:
python3 scripts/supervisor.py --file _learn/bubble_sort/cpp_exercise.cpp
- Logs: Feedback is saved to
_learn/learning_log.md.
- Ensure you have Ollama installed and running.
- Pick an algorithm in
_learn/. - Fill in the blanks.
- Run the supervisor to check your work!
We are actively converting algorithms. Here is the current progress:
- Insertion Sort
- Selection Sort
- Heap Sort
- Knuth-Morris-Pratt (KMP)
- Rabin-Karp
- Z-Function
- Caesar Cipher
- Vigenere Cipher
- Euclidean GCD
- Sieve of Eratosthenes
- N-Queens
- Sudoku Solver
- Binary Search
- Single Number
- Matrix Multiplication
- Matrix Transposition
- Strassen's Algorithm
- Rotate Matrix
Forked from TheAlgorithms/Python