A free, open-source course that takes you from "I know basic Python" to "I can solve interview problems". Every topic has theory with an analogy, a diagram, a complexity table, clean Python code, a worked trace, a runnable notebook and 13 practice problems (5 easy, 5 medium, 3 hard).
Replace
rafidahmed870in badges and notebook links with your GitHub user name after you fork or publish the repo.
- Plan: follow the 12-week ROADMAP (checkboxes included).
- Learn: read a lesson in
docs/, then open the matching notebook (Colab or local) and change the code. - Practise: solve the problems in
practice/<module>/problems.mdbefore opening the solutions. - Revise: keep the one-page CHEATSHEET next to you.
flowchart LR
A[00 Intro] --> B[01 Complexity]
B --> C[02 Arrays and strings]
C --> D[03 Linked lists]
D --> E[04 Stacks and queues]
E --> F[05 Hashing]
F --> G[06 Recursion]
G --> H[07 Trees]
H --> I[08 Heaps]
I --> J[09 Graphs]
J --> K[10 Sorting and searching]
K --> L[11 Dynamic programming]
L --> M[12 Greedy]
M --> N[13 Advanced]
N --> O[14 Interview patterns]
Each lesson follows the same 11-part template: summary, why it matters, concept with an analogy, diagram, operations table (time and space), Python implementation, worked trace, common mistakes, when to use it, practice problems and links.
git clone https://github.com/rafidahmed870/Data-Structures-And-Algorithms.git
cd dsa-guide
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
pip install -e .
jupyter notebook notebooks/ # or open any notebook in Google Colab with the badge at its top
pytest -q # run all testsNo setup at all? Click a Colab or Binder badge at the top of any notebook.
dsa-guide/
docs/ lessons (markdown), one folder per module, plus docs/bn/ for translations
notebooks/ one runnable notebook per lesson (same numbering as docs)
src/dsa/ clean, typed, importable implementations (pure Python, no libraries for core logic)
tests/ pytest tests for every implementation, plus repo integrity checks
practice/ problems.md per module and solutions/ (runnable files checked by the tests)
assets/ images
ROADMAP.md 12-week study plan with checkboxes
CHEATSHEET.md one-page complexity table and "which data structure should I use?" guide
Try the code directly:
from dsa.sorting import merge_sort
from dsa.graphs import Graph, dijkstra
print(merge_sort([5, 2, 9, 1])) # [1, 2, 5, 9]
g = Graph.from_edges([("A", "B", 4), ("A", "C", 1), ("C", "B", 2)])
print(dijkstra(g, "A")[0]) # {'A': 0, 'B': 3, 'C': 1}The explanations are written in simple English. A Bangla translation is planned: see
docs/bn/README.md for the structure and how to help.
Issues and pull requests are welcome: see CONTRIBUTING.md and the Code of Conduct. Issue templates exist for new topic, fix error and translation.
