Skip to content

About

A complete, beginner-to-advanced Data Structures & Algorithms learning guide in Python

Topics

Resources

Code of conduct

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Repository files navigation

DSA Guide: Data Structures & Algorithms from Zero to Interview-Ready

License: MIT CI Python 3.10+ Open in Colab Binder

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).

Sorting benchmark produced by the notebooks

Replace rafidahmed870 in badges and notebook links with your GitHub user name after you fork or publish the repo.

Table of contents

How to use this repo

  1. Plan: follow the 12-week ROADMAP (checkboxes included).
  2. Learn: read a lesson in docs/, then open the matching notebook (Colab or local) and change the code.
  3. Practise: solve the problems in practice/<module>/problems.md before opening the solutions.
  4. Revise: keep the one-page CHEATSHEET next to you.

Learning path

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]
Loading

Curriculum

# Lesson Notebook Practice
00 What Is DSA and How to Study It notebook problems
01 Big-O, Omega, Theta, Amortized and Space Complexity notebook problems
02 Arrays, Dynamic Arrays and Prefix Sums notebook problems
02 Two Pointers and Sliding Window notebook problems
02 Strings and Pattern Matching notebook problems
03 Linked Lists notebook problems
04 Stacks, Queues, Deques and the Monotonic Stack notebook problems
05 Hash Maps and Sets notebook problems
06 Recursion and Backtracking notebook problems
07 Binary Trees, BSTs, Traversals and AVL Basics notebook problems
08 Heaps and Priority Queues notebook problems
09 Graphs: Representations, BFS, DFS and Topological Sort notebook problems
09 Shortest Paths (Dijkstra, Bellman-Ford) and Minimum Spanning Trees notebook problems
10 Sorting Algorithms: Bubble to Radix notebook problems
10 Searching: Linear Search, Binary Search and Its Variations notebook problems
11 Dynamic Programming: Memoization, Tabulation and the Classics notebook problems
12 Greedy Algorithms: Interval Scheduling and Huffman Coding notebook problems
13 Trie (Prefix Tree) notebook problems
13 Segment Tree and Fenwick Tree (Binary Indexed Tree) notebook problems
13 Union-Find (Disjoint Sets) and Bit Manipulation notebook problems
14 The 15 Core Interview Patterns and a Recognition Checklist notebook problems

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.

Quick start

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 tests

No setup at all? Click a Colab or Binder badge at the top of any notebook.

Repository layout

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}

Languages

The explanations are written in simple English. A Bangla translation is planned: see docs/bn/README.md for the structure and how to help.

Contributing

Issues and pull requests are welcome: see CONTRIBUTING.md and the Code of Conduct. Issue templates exist for new topic, fix error and translation.

License

MIT

About

A complete, beginner-to-advanced Data Structures & Algorithms learning guide in Python

Topics

Resources

Code of conduct

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages