Master data structures and algorithms with an AI tutor — step-by-step explanations, code generation, complexity analysis, and adaptive practice problems.
Topics: algorithms · coding-assistant · competitive-programming · data-structures · deep-learning · education-ai · gemma-3 · generative-ai · google-ai · llm-tutoring
DSA Mastery with Gemma 3 is an AI-powered learning platform for data structures and algorithms, using Google's Gemma 3 language model as the teaching engine. It goes beyond static content: the tutor adapts to the learner's level, generates novel practice problems on demand, provides step-by-step execution traces with visual annotation, and offers multi-language code implementations with line-by-line commentary.
The platform covers the full DSA curriculum: arrays, linked lists, stacks, queues, trees (BST, AVL, heap, trie), graphs (BFS, DFS, Dijkstra, Bellman-Ford, Prim, Kruskal), dynamic programming (memoisation, tabulation, common problem families), sorting and searching algorithms, and string algorithms (KMP, Z-algorithm, suffix arrays). For each topic, the platform provides conceptual explanation, code implementation, time/space complexity analysis with formal proof sketch, and curated practice problems at Easy/Medium/Hard difficulty.
The complexity analysis module is particularly thorough: it not only states the Big-O complexity but explains the reasoning — recurrence relations for recursive algorithms, amortised analysis for dynamic arrays, and master theorem application for divide-and-conquer — building genuine analytical intuition rather than memorised complexity tables.
DSA is the foundation of technical interviews at top technology companies and the backbone of efficient software engineering. Yet most learning resources present algorithms as static content: read the solution, understand it, move on. What learners need is an interactive partner who can explain, answer follow-up questions, generate variations, and challenge them with novel problems — which is exactly what an LLM tutor provides.
Learner Query (topic / problem / code)
│
Topic Detection + Context Building
│
Gemma 3 Tutor (contextualised prompt)
├── Conceptual explanation
├── Step-by-step trace
├── Code generation (Python / C++ / Java)
└── Complexity analysis
│
Practice Problem Generator
(novel, parameterised, difficulty-scaled)
│
Progress tracker → Weak area identification
All major topics: arrays, linked lists, trees, graphs, heaps, tries, sorting/searching, DP, string algorithms — each with conceptual explanation, code, and complexity analysis.
Visual step-by-step execution trace with variable state at each step, array/tree state visualised in ASCII or Mermaid diagrams, and pointer movement annotation.
Implementations in Python (clean and readable), C++ (performance-focused with STL), and Java (OOP style) — with line-by-line comments explaining each step.
Time and space complexity derived from first principles: recurrence relations (T(n) = 2T(n/2) + O(n)), master theorem application, and amortised analysis for relevant algorithms.
Generate novel problems at Easy/Medium/Hard difficulty for any topic, with constraints, example test cases, and expected output — parameterised to avoid repetition.
Paste your solution and receive feedback on correctness, edge case handling, time/space complexity, code style, and potential optimisations.
Ask any DSA question in natural language — 'Why is quicksort not stable?', 'When should I use a deque instead of a stack?' — and get a precise, educational answer.
Track topics covered, problems solved, accuracy by difficulty level, and a heatmap of topic proficiency to guide study prioritisation.
| Library / Tool | Role | Why This Choice |
|---|---|---|
| Google Gemma 3 API | AI tutoring engine | Explanation generation, code synthesis, problem creation |
| Streamlit | Application UI | Chat interface, code rendering, progress dashboard |
| Python | Primary language | Algorithm implementations for verification |
| Plotly | Visualisation | Progress charts, topic proficiency radar |
| pandas | Progress tracking | Session history and topic performance storage |
Key packages detected in this repo:
streamlit·google-generativeai·plotly·pandas·numpy
- Python 3.9+ (or Node.js 18+ for TypeScript/JS projects)
pipornpmpackage manager- Relevant API keys (see Configuration section)
git clone https://github.com/Devanik21/DSA-mastery-with-gemma-3.git
cd DSA-mastery-with-gemma-3
python -m venv venv && source venv/bin/activate
pip install streamlit google-generativeai pandas plotly
echo 'GOOGLE_API_KEY=your_key_here' > .env
streamlit run app.pystreamlit run app.py
# CLI usage
python tutor_cli.py --topic 'binary search tree' --level medium
# Generate practice problems
python generate_problems.py --topic 'dynamic programming' --difficulty hard --count 5| Variable | Default | Description |
|---|---|---|
GOOGLE_API_KEY |
(required) |
Google API key for Gemma 3 |
DEFAULT_LANGUAGE |
python |
Code generation language: python, cpp, java |
DIFFICULTY_DEFAULT |
medium |
Default problem difficulty: easy, medium, hard |
TRACE_DETAIL |
high |
Step-by-step trace verbosity: low, medium, high |
Copy
.env.exampleto.envand populate all required values before running.
DSA-mastery-with-gemma-3/
├── README.md
├── requirements.txt
├── app.py
└── ...
- Interactive code editor with test case runner for in-app solution verification
- LeetCode problem import: paste a LeetCode URL and get AI hints without spoilers
- Contest mode: timed problem sets simulating real technical interview sessions
- Spaced repetition system for optimal review scheduling of mastered topics
- Peer comparison: anonymised performance benchmarking against other learners
Contributions, issues, and feature requests are welcome. Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'feat: add your feature') - Push to your branch (
git push origin feature/your-feature) - Open a Pull Request
Please follow conventional commit messages and ensure any new code is documented.
Gemma 3 API responses are educational explanations and should be verified against authoritative DSA references for critical applications. Complexity analyses are correct for standard algorithm implementations but may vary with specific optimisations.
Devanik Debnath
B.Tech, Electronics & Communication Engineering
National Institute of Technology Agartala
This project is open source and available under the MIT License.
Crafted with curiosity, precision, and a belief that good software is worth building well.