Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

DSA in Python — Course Track

Learn to think like a computer scientist. This track takes you from raw memory all the way to dynamic programming, building genuine intuition at every step.


Why This Track Exists

Every time you use Google Maps, Spotify’s shuffle, or Instagram’s feed, data structures and algorithms are running underneath. The code that makes those products fast isn’t magic — it’s the same ideas you’ll learn here, applied with care.

This track is structured like a course with a deliberate progression:

  1. Start with memory and arrays — understand how data actually lives in RAM before touching any abstraction.
  2. Move to linear structures — linked lists and queues that flex where arrays are rigid.
  3. Build recursion intuition — train your brain to think in sub-problems.
  4. Master sorting — the proving ground for algorithmic thinking.
  5. Climb to advanced territory — trees, graphs, heaps, hashing, and dynamic programming.

Each section answers three questions: What is the data layout? Which operations are cheap? What trade-off is being made?


Sections

  • Introduction What is a data structure? What is an algorithm? Why do they power the modern world?

  • Algorithm Analysis Big O notation, time vs space complexity, and how to reason about performance mathematically.


Arrays

The foundation of almost every other data structure. Understand arrays and you understand memory.


Linked Lists

Flexible structures where elements can live anywhere in memory, connected by pointers.


Recursion

The art of solving a problem by solving a smaller version of itself.


Sorting

Rearranging data is the most studied problem in computer science — and for good reason.

  • Overview
  • Insertion SortSimple, intuitive, and surprisingly fast on small inputs.
  • Merge SortDivide, conquer, and merge — reliably O(n log n).
  • Quick SortThe algorithm powering most real-world sort implementations.
  • Bucket SortWhen you know something about your data, you can beat O(n log n).

Find anything in a sorted collection in O(log n) — eliminate half the possibilities each step.


Trees

Hierarchical structures that power databases, file systems, and autocomplete.


Backtracking

Explore every possibility systematically — and prune dead ends early.

  • Overview
  • Tree MazeNavigate a maze by trying every path and retreating when stuck.
  • SubsetsGenerate every subset of a set systematically.
  • CombinationsChoose k items from n — without repetition.
  • PermutationsEvery possible ordering of a set of elements.

Heap / Priority Queue

Always get the minimum (or maximum) element in O(log n). Used in Dijkstra’s and task scheduling.


Hashing

The secret behind Python’s dict and set — O(1) average lookup via math.


Graphs

The most general structure — social networks, maps, and the internet are all graphs.


Dynamic Programming

Solve complex problems by caching the results of overlapping sub-problems.

  • Overview
  • 1-Dimension DPSingle-variable state: climbing stairs, coin change.
  • 2-Dimension DPGrid problems and string comparisons.
  • 0 / 1 KnapsackPick items with weights and values — each item used at most once.
  • Unbounded KnapsackSame as knapsack but items can be reused unlimited times.
  • LCSFind the longest sequence common to two strings.
  • PalindromesDetect and build palindromic substrings with DP.

Bit Manipulation

Use binary operations directly — the lowest level of computation, and often the fastest.