15 Chapters · 86 Visual Lessons · 9 Free to Start

Data Structures & Algorithms Curriculum

Every topic in Byte Sized Algorithms pairs an interactive diagram with synchronized pseudocode and live state updates. Browse any lesson guide below for complexity reference and intuition, or launch directly into the interactive classroom.

Complete 15-Chapter Syllabus

Chapter 1 · 4 lessons · Beginner

Algorithm Fundamentals

Free

Build mental models for asymptotic growth, memory layout, recursive call stacks, and divide-and-conquer decomposition.

  1. 01
    Big-O Notation and Growth Rates

    Time: O(1) to O(2ⁿ) classes · Space: Varies by algorithm

  2. 02
    Memory Addresses and Pointers

    Time: O(1) direct address lookup · Space: O(1) per pointer

  3. 03
    Recursion and the Call Stack

    Time: O(branchingᵈ) or O(n) · Space: O(depth) call stack

  4. 04
    Divide and Conquer

    Time: Often O(n log n) or O(log n) · Space: O(log n) to O(n)

Chapter 3 · 7 lessons · Intermediate

Array & String Techniques

Pro

Replace quadratic nested loops with linear-time two pointers, sliding windows, prefix sums, Kadane’s algorithm, interval merging, and KMP search.

  1. 10
    Two Pointers on a Sorted Array

    Time: O(n) after sorting · Space: O(1)

  2. 11
    Fixed-Size Sliding Window

    Time: O(n) · Space: O(1) or O(alphabet)

  3. 12
    Prefix Sums for Range Queries

    Time: O(n) build, O(1) per query · Space: O(n)

  4. 14
    Merging Overlapping Intervals

    Time: O(n log n) · Space: O(n)

  5. 15
    Naive String Matching

    Time: O(n × m) worst case · Space: O(1)

  6. 16
    Knuth–Morris–Pratt String Search

    Time: O(n + m) · Space: O(m)

Chapter 4 · 6 lessons · Beginner

Linked Lists

Pro

Trace pointer rewiring step by step across singly and doubly linked lists, cycle detection, in-place reversal, merging, and LRU caches.

  1. 17
    Singly Linked Lists

    Time: O(1) head insert, O(n) search · Space: O(n)

  2. 18
    Doubly Linked Lists

    Time: O(1) insert/delete at node, O(n) search · Space: O(n)

  3. 20
    In-Place Linked List Reversal

    Time: O(n) · Space: O(1)

  4. 21
    Merging Two Sorted Linked Lists

    Time: O(n + m) · Space: O(1)

  5. 22
    Least Recently Used Cache

    Time: O(1) get and put · Space: O(capacity)

Chapter 5 · 7 lessons · Intermediate

Stacks & Queues

Pro

Use LIFO, FIFO, circular buffers, deques, and monotonic structures to solve bracket parsing, next-greater queries, and sliding-window maxima in O(n).

  1. 23
    Stacks and LIFO Order

    Time: O(1) push, pop, peek · Space: O(n)

  2. 24
    Stack-Based Bracket Matching

    Time: O(n) · Space: O(n)

  3. 25
    Queues and FIFO Order

    Time: O(1) enqueue and dequeue · Space: O(n)

  4. 26
    Circular Buffers and Wraparound

    Time: O(1) enqueue and dequeue · Space: O(capacity)

  5. 27
    Double-Ended Queues

    Time: O(1) front/back push and pop · Space: O(n)

  6. 28

Chapter 6 · 5 lessons · Intermediate

Hashing

Pro

See how hash functions map keys to buckets, resolve collisions, trigger rehashing, power sets and maps, and enable probabilistic Bloom filters.

  1. 30
    Hash Tables and Bucket Lookup

    Time: O(1) average, O(n) worst case · Space: O(n)

  2. 31
    Resolving Hash Collisions

    Time: O(1) average under low load factor · Space: O(n)

  3. 32
    Hash Table Resizing and Rehashing

    Time: O(1) amortized insert, O(n) rehash · Space: O(n)

  4. 33
    Sets for Membership, Maps for Lookup

    Time: O(1) average lookup/insert · Space: O(n)

  5. 34
    Bloom Filters and False Positives

    Time: O(k) insert and query · Space: O(m) bits

Chapter 7 · 8 lessons · Intermediate

Trees

Pro

Visualize hierarchical structures from binary tree traversals and BST deletions to self-balancing rotations, prefix tries, and segment trees.

  1. 35
    Binary Tree Structure

    Time: O(n) full traversal · Space: O(h) recursion stack

  2. 36
    Depth-First and Level-Order Tree Traversals

    Time: O(n) · Space: O(h) DFS, O(w) BFS

  3. 37
    Finding the Lowest Common Ancestor

    Time: O(n) general tree, O(h) BST · Space: O(h)

  4. 38
    Binary Search Trees and Key Ordering

    Time: O(h) — O(log n) balanced, O(n) skewed · Space: O(h)

  5. 39
    Deletion in a Binary Search Tree

    Time: O(h) · Space: O(h) recursive, O(1) iterative

  6. 40
    Balanced Search Trees and Rotations

    Time: O(log n) search, insert, delete · Space: O(n)

  7. 41
    Tries for Prefix Search

    Time: O(L) per word of length L · Space: O(total characters)

  8. 42
    Segment Trees for Range Sums

    Time: O(n) build, O(log n) query/update · Space: O(n) (4n array)

Chapter 8 · 5 lessons · Intermediate

Heaps & Priority Queues

Pro

Maintain partially ordered binary heaps for O(log n) priority updates, linear-time heapification, top-K selection, and streaming medians.

  1. 43
    Binary Heaps and Heap Order

    Time: O(1) peek, O(log n) push/pop · Space: O(n)

  2. 44
    Bottom-Up Heap Construction

    Time: O(n) · Space: O(1) in-place

  3. 45
    Priority Queues and Priority Order

    Time: O(1) peek, O(log n) push/pop · Space: O(n)

  4. 46
    Finding the Top K with a Heap

    Time: O(n log k) · Space: O(k)

  5. 47
    Streaming Median with Two Heaps

    Time: O(log n) insert, O(1) median · Space: O(n)

Chapter 9 · 7 lessons · Intermediate

Sorting & Selection

Pro

Compare quadratic, divide-and-conquer, heap-based, and linear non-comparison sorting algorithms alongside stability, lower bounds, and Quickselect.

  1. 48
    Selection Sort and Insertion Sort

    Time: O(n²) worst, O(n) insertion best · Space: O(1)

  2. 49
    Merge Sort and Sorted Runs

    Time: O(n log n) guaranteed · Space: O(n) array, O(log n) linked list

  3. 50
    Quicksort and Pivot Partitioning

    Time: O(n log n) average, O(n²) worst · Space: O(log n) stack

  4. 51
    Heapsort with a Max-Heap

    Time: O(n log n) worst case · Space: O(1) in-place

  5. 52
    Counting Sort and LSD Radix Sort

    Time: O(n + k) counting, O(d(n + b)) radix · Space: O(n + k)

  6. 53
    Sort Stability and the Comparison Lower Bound

    Time: Ω(n log n) comparison lower bound · Space: Depends on algorithm

  7. 54
    Quickselect for the Kth Element

    Time: O(n) expected, O(n²) worst · Space: O(1) iterative

Chapter 10 · 3 lessons · Intermediate

Greedy Algorithms

Pro

Learn when locally optimal choices yield global optima in interval scheduling and Huffman coding—and how to spot counterexamples where greedy fails.

  1. 55
    Greedy Interval Scheduling by Finish Time

    Time: O(n log n) · Space: O(1) extra

  2. 56
    Huffman Coding and Prefix Codes

    Time: O(n log n) · Space: O(n)

  3. 57
    Recognizing When Greedy Choices Fail

    Time: Counterexample analysis · Space: O(1)

Chapter 11 · 7 lessons · Intermediate

Graph Traversal & Connectivity

Pro

Explore adjacency representations, BFS, DFS, connected components, directed cycle detection, topological sorting, and strongly connected components.

  1. 58
    Graph Representations

    Time: O(1) matrix edge check, O(deg(v)) list scan · Space: O(V + E) list, O(V²) matrix

  2. 59
    Breadth-First Search (BFS)

    Time: O(V + E) · Space: O(V)

  3. 60
    Depth-First Search (DFS)

    Time: O(V + E) · Space: O(V)

  4. 61
    Counting Connected Components

    Time: O(V + E) · Space: O(V)

  5. 62
    Detecting Cycles in a Directed Graph

    Time: O(V + E) · Space: O(V)

  6. 63
    Topological Order in a DAG

    Time: O(V + E) · Space: O(V)

  7. 64
    Strong Connectivity in Directed Graphs

    Time: O(V + E) · Space: O(V)

Chapter 12 · 6 lessons · Advanced

Shortest Paths & Spanning Trees

Pro

Compute shortest paths with Dijkstra, Bellman–Ford, and Floyd–Warshall, and build minimum spanning trees using Union–Find, Kruskal, and Prim.

  1. 65
    Dijkstra’s Shortest-Path Algorithm

    Time: O((V + E) log V) · Space: O(V + E)

  2. 66
    Bellman–Ford and Negative Edge Weights

    Time: O(V × E) · Space: O(V)

  3. 67
    Floyd–Warshall All-Pairs Shortest Paths

    Time: O(V³) · Space: O(V²)

  4. 68
    Disjoint Sets with Union–Find

    Time: O(α(n)) amortized (~O(1)) · Space: O(n)

  5. 69
    Kruskal’s Minimum Spanning Tree Algorithm

    Time: O(E log E) · Space: O(V)

  6. 70
    Prim’s Minimum Spanning Tree Algorithm

    Time: O((V + E) log V) · Space: O(V + E)

Chapter 13 · 8 lessons · Advanced

Dynamic Programming

Pro

Eliminate redundant subproblems with top-down memoization and bottom-up tabulation across grids, knapsack, coin change, LIS, LCS, and edit distance.

  1. 71
    Top-Down DP with Memoization

    Time: O(states × transition) · Space: O(states + recursion depth)

  2. 72
    Bottom-Up DP with Tabulation

    Time: O(states × transition) · Space: O(states), often reducible

  3. 73
    Counting Grid Paths with Dynamic Programming

    Time: O(R × C) · Space: O(R × C) or O(C) rolling

  4. 74
    0/1 Knapsack Dynamic Programming

    Time: O(n × W) · Space: O(W) 1D rolling array

  5. 75
    Minimum-Coin Change with Dynamic Programming

    Time: O(amount × coins) · Space: O(amount)

  6. 76
    Longest Increasing Subsequence (LIS)

    Time: O(n²) DP, O(n log n) with binary search · Space: O(n)

  7. 77
    Longest Common Subsequence (LCS)

    Time: O(m × n) · Space: O(m × n) or O(min(m, n))

  8. 78
    Levenshtein Edit Distance

    Time: O(m × n) · Space: O(m × n) or O(min(m, n))

Chapter 14 · 5 lessons · Advanced

Backtracking & Computational Complexity

Pro

Navigate decision trees systematically with pruning for subsets, permutations, N-Queens, and maze search, then formalize P vs NP complexity.

  1. 79
    Generating Subsets by Backtracking

    Time: O(n × 2ⁿ) · Space: O(n) recursion + output

  2. 80
    Generating Permutations by Backtracking

    Time: O(n × n!) · Space: O(n) recursion + output

  3. 81
    N-Queens with Constraint Checking

    Time: O(N!) upper bound, heavily pruned · Space: O(N)

  4. 82
    Maze Search with Backtracking

    Time: O(4^(R×C)) all paths, O(R×C) single path · Space: O(R × C)

  5. 83
    P vs NP: Solving and Verifying

    Time: Polynomial vs exponential boundary · Space: Complexity classes

Chapter 15 · 3 lessons · Intermediate

Bit Manipulation

Pro

Operate directly on binary representations using bit masks, classic bitwise idioms, and compact bitsets for fast set arithmetic.

  1. 84
    Bit Masks for Testing and Updating Bits

    Time: O(1) per bitwise op · Space: O(1)

  2. 85
    Bitwise Idioms and Their Preconditions

    Time: O(1) or O(popcount) · Space: O(1)

  3. 86
    Bitsets for Set Operations

    Time: O(N / 64) set ops, O(1) bit check · Space: O(N / 8) bytes

Unlock the full course

All 86 lessons across 15 chapters

View pricing

Delete account

This permanently deletes your account and ends any Pro access.