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
Algorithm Fundamentals
Build mental models for asymptotic growth, memory layout, recursive call stacks, and divide-and-conquer decomposition.
- 01Big-O Notation and Growth Rates
Time:
O(1) to O(2ⁿ) classes· Space:Varies by algorithm - 02Memory Addresses and Pointers
Time:
O(1) direct address lookup· Space:O(1) per pointer - 03Recursion and the Call Stack
Time:
O(branchingᵈ) or O(n)· Space:O(depth) call stack - 04Divide and Conquer
Time:
Often O(n log n) or O(log n)· Space:O(log n) to O(n)
Arrays & Binary Search
Master contiguous memory indexing, amortized dynamic resizing, 2D grids, and logarithmic search over sorted arrays and monotone answer spaces.
- 05Arrays and Indexing
Time:
O(1) read, O(n) mid insert/delete· Space:O(n) - 06Dynamic Arrays and Resizing
Time:
O(1) amortized append, O(n) resize· Space:O(n) - 07Two-Dimensional Arrays
Time:
O(1) cell access, O(R × C) scan· Space:O(R × C) - 08Binary Search on a Sorted Array
Time:
O(log n)· Space:O(1) iterative - 09Binary Search on a Monotone Answer Space
Time:
O(log(range) × T(check))· Space:O(1) extra
Array & String Techniques
Replace quadratic nested loops with linear-time two pointers, sliding windows, prefix sums, Kadane’s algorithm, interval merging, and KMP search.
- 10Two Pointers on a Sorted Array
Time:
O(n) after sorting· Space:O(1) - 11Fixed-Size Sliding Window
Time:
O(n)· Space:O(1) or O(alphabet) - 12Prefix Sums for Range Queries
Time:
O(n) build, O(1) per query· Space:O(n) - 13Maximum Subarray with Kadane’s Algorithm
Time:
O(n)· Space:O(1) - 14Merging Overlapping Intervals
Time:
O(n log n)· Space:O(n) - 15Naive String Matching
Time:
O(n × m) worst case· Space:O(1) - 16Knuth–Morris–Pratt String Search
Time:
O(n + m)· Space:O(m)
Linked Lists
Trace pointer rewiring step by step across singly and doubly linked lists, cycle detection, in-place reversal, merging, and LRU caches.
- 17Singly Linked Lists
Time:
O(1) head insert, O(n) search· Space:O(n) - 18Doubly Linked Lists
Time:
O(1) insert/delete at node, O(n) search· Space:O(n) - 19Fast and Slow Pointers: Midpoint and Cycles
Time:
O(n)· Space:O(1) - 20In-Place Linked List Reversal
Time:
O(n)· Space:O(1) - 21Merging Two Sorted Linked Lists
Time:
O(n + m)· Space:O(1) - 22Least Recently Used Cache
Time:
O(1) get and put· Space:O(capacity)
Stacks & Queues
Use LIFO, FIFO, circular buffers, deques, and monotonic structures to solve bracket parsing, next-greater queries, and sliding-window maxima in O(n).
- 23Stacks and LIFO Order
Time:
O(1) push, pop, peek· Space:O(n) - 24Stack-Based Bracket Matching
Time:
O(n)· Space:O(n) - 25Queues and FIFO Order
Time:
O(1) enqueue and dequeue· Space:O(n) - 26Circular Buffers and Wraparound
Time:
O(1) enqueue and dequeue· Space:O(capacity) - 27Double-Ended Queues
Time:
O(1) front/back push and pop· Space:O(n) - 28Monotonic Stack for Next Greater Element
Time:
O(n)· Space:O(n) - 29Monotonic Queue for Sliding-Window Maximum
Time:
O(n)· Space:O(k)
Hashing
See how hash functions map keys to buckets, resolve collisions, trigger rehashing, power sets and maps, and enable probabilistic Bloom filters.
- 30Hash Tables and Bucket Lookup
Time:
O(1) average, O(n) worst case· Space:O(n) - 31Resolving Hash Collisions
Time:
O(1) average under low load factor· Space:O(n) - 32Hash Table Resizing and Rehashing
Time:
O(1) amortized insert, O(n) rehash· Space:O(n) - 33Sets for Membership, Maps for Lookup
Time:
O(1) average lookup/insert· Space:O(n) - 34Bloom Filters and False Positives
Time:
O(k) insert and query· Space:O(m) bits
Trees
Visualize hierarchical structures from binary tree traversals and BST deletions to self-balancing rotations, prefix tries, and segment trees.
- 35Binary Tree Structure
Time:
O(n) full traversal· Space:O(h) recursion stack - 36Depth-First and Level-Order Tree Traversals
Time:
O(n)· Space:O(h) DFS, O(w) BFS - 37Finding the Lowest Common Ancestor
Time:
O(n) general tree, O(h) BST· Space:O(h) - 38Binary Search Trees and Key Ordering
Time:
O(h) — O(log n) balanced, O(n) skewed· Space:O(h) - 39Deletion in a Binary Search Tree
Time:
O(h)· Space:O(h) recursive, O(1) iterative - 40Balanced Search Trees and Rotations
Time:
O(log n) search, insert, delete· Space:O(n) - 41Tries for Prefix Search
Time:
O(L) per word of length L· Space:O(total characters) - 42Segment Trees for Range Sums
Time:
O(n) build, O(log n) query/update· Space:O(n) (4n array)
Heaps & Priority Queues
Maintain partially ordered binary heaps for O(log n) priority updates, linear-time heapification, top-K selection, and streaming medians.
- 43Binary Heaps and Heap Order
Time:
O(1) peek, O(log n) push/pop· Space:O(n) - 44Bottom-Up Heap Construction
Time:
O(n)· Space:O(1) in-place - 45Priority Queues and Priority Order
Time:
O(1) peek, O(log n) push/pop· Space:O(n) - 46Finding the Top K with a Heap
Time:
O(n log k)· Space:O(k) - 47Streaming Median with Two Heaps
Time:
O(log n) insert, O(1) median· Space:O(n)
Sorting & Selection
Compare quadratic, divide-and-conquer, heap-based, and linear non-comparison sorting algorithms alongside stability, lower bounds, and Quickselect.
- 48Selection Sort and Insertion Sort
Time:
O(n²) worst, O(n) insertion best· Space:O(1) - 49Merge Sort and Sorted Runs
Time:
O(n log n) guaranteed· Space:O(n) array, O(log n) linked list - 50Quicksort and Pivot Partitioning
Time:
O(n log n) average, O(n²) worst· Space:O(log n) stack - 51Heapsort with a Max-Heap
Time:
O(n log n) worst case· Space:O(1) in-place - 52Counting Sort and LSD Radix Sort
Time:
O(n + k) counting, O(d(n + b)) radix· Space:O(n + k) - 53Sort Stability and the Comparison Lower Bound
Time:
Ω(n log n) comparison lower bound· Space:Depends on algorithm - 54Quickselect for the Kth Element
Time:
O(n) expected, O(n²) worst· Space:O(1) iterative
Greedy Algorithms
Learn when locally optimal choices yield global optima in interval scheduling and Huffman coding—and how to spot counterexamples where greedy fails.
- 55Greedy Interval Scheduling by Finish Time
Time:
O(n log n)· Space:O(1) extra - 56Huffman Coding and Prefix Codes
Time:
O(n log n)· Space:O(n) - 57Recognizing When Greedy Choices Fail
Time:
Counterexample analysis· Space:O(1)
Graph Traversal & Connectivity
Explore adjacency representations, BFS, DFS, connected components, directed cycle detection, topological sorting, and strongly connected components.
- 58Graph Representations
Time:
O(1) matrix edge check, O(deg(v)) list scan· Space:O(V + E) list, O(V²) matrix - 59Breadth-First Search (BFS)
Time:
O(V + E)· Space:O(V) - 60Depth-First Search (DFS)
Time:
O(V + E)· Space:O(V) - 61Counting Connected Components
Time:
O(V + E)· Space:O(V) - 62Detecting Cycles in a Directed Graph
Time:
O(V + E)· Space:O(V) - 63Topological Order in a DAG
Time:
O(V + E)· Space:O(V) - 64Strong Connectivity in Directed Graphs
Time:
O(V + E)· Space:O(V)
Shortest Paths & Spanning Trees
Compute shortest paths with Dijkstra, Bellman–Ford, and Floyd–Warshall, and build minimum spanning trees using Union–Find, Kruskal, and Prim.
- 65Dijkstra’s Shortest-Path Algorithm
Time:
O((V + E) log V)· Space:O(V + E) - 66Bellman–Ford and Negative Edge Weights
Time:
O(V × E)· Space:O(V) - 67Floyd–Warshall All-Pairs Shortest Paths
Time:
O(V³)· Space:O(V²) - 68Disjoint Sets with Union–Find
Time:
O(α(n)) amortized (~O(1))· Space:O(n) - 69Kruskal’s Minimum Spanning Tree Algorithm
Time:
O(E log E)· Space:O(V) - 70Prim’s Minimum Spanning Tree Algorithm
Time:
O((V + E) log V)· Space:O(V + E)
Dynamic Programming
Eliminate redundant subproblems with top-down memoization and bottom-up tabulation across grids, knapsack, coin change, LIS, LCS, and edit distance.
- 71Top-Down DP with Memoization
Time:
O(states × transition)· Space:O(states + recursion depth) - 72Bottom-Up DP with Tabulation
Time:
O(states × transition)· Space:O(states), often reducible - 73Counting Grid Paths with Dynamic Programming
Time:
O(R × C)· Space:O(R × C) or O(C) rolling - 740/1 Knapsack Dynamic Programming
Time:
O(n × W)· Space:O(W) 1D rolling array - 75Minimum-Coin Change with Dynamic Programming
Time:
O(amount × coins)· Space:O(amount) - 76Longest Increasing Subsequence (LIS)
Time:
O(n²) DP, O(n log n) with binary search· Space:O(n) - 77Longest Common Subsequence (LCS)
Time:
O(m × n)· Space:O(m × n) or O(min(m, n)) - 78Levenshtein Edit Distance
Time:
O(m × n)· Space:O(m × n) or O(min(m, n))
Backtracking & Computational Complexity
Navigate decision trees systematically with pruning for subsets, permutations, N-Queens, and maze search, then formalize P vs NP complexity.
- 79Generating Subsets by Backtracking
Time:
O(n × 2ⁿ)· Space:O(n) recursion + output - 80Generating Permutations by Backtracking
Time:
O(n × n!)· Space:O(n) recursion + output - 81N-Queens with Constraint Checking
Time:
O(N!) upper bound, heavily pruned· Space:O(N) - 82Maze Search with Backtracking
Time:
O(4^(R×C)) all paths, O(R×C) single path· Space:O(R × C) - 83P vs NP: Solving and Verifying
Time:
Polynomial vs exponential boundary· Space:Complexity classes
Bit Manipulation
Operate directly on binary representations using bit masks, classic bitwise idioms, and compact bitsets for fast set arithmetic.
- 84Bit Masks for Testing and Updating Bits
Time:
O(1) per bitwise op· Space:O(1) - 85Bitwise Idioms and Their Preconditions
Time:
O(1) or O(popcount)· Space:O(1) - 86Bitsets for Set Operations
Time:
O(N / 64) set ops, O(1) bit check· Space:O(N / 8) bytes