All roadmaps

Structures Mix roadmap

Problems where two or three structures have to work together.

For: Know each structure alone, ready to combine them

Two Pointers

Walk a sequence from both ends, or at two speeds, to avoid nested loops.

Sliding Window

Keep a moving range valid while you slide it across the input.

Prefix Sums

Precompute running totals so any range sum costs one subtraction.

Stack

Last in, first out. Use it to match pairs and undo work.

Binary Search

Halve the search space each step, on sorted data or on an answer range.

Monotonic Stack

Keep the stack ordered to find the next greater or smaller item in one pass.

Queue and Deque

First in, first out, plus a deque for sliding maximums and level-by-level work.

Design

Combine data structures to build a cache, a stack with extras or an iterator.

Heap / Priority Queue

Always get the smallest or largest item next without sorting everything.

Tries

Share prefixes in a tree of characters for fast prefix and dictionary lookups.

Trees

Think recursively: solve a node from the answers for its children.

Graphs

Traverse connected structures: islands, components, shortest hops in a grid.

1-D Dynamic Programming

Break a problem into overlapping subproblems and store each answer once.

Topological Sort

Order tasks by their dependencies and detect cycles.

Union-Find

Track which items are connected with near-constant-time merges and lookups.

Shortest Paths

Dijkstra and Bellman-Ford for weighted graphs.

Knapsack and Subset DP

Choose items under a budget; the pattern behind coin change and partitions.

2-D Dynamic Programming

Fill a table indexed by two variables: grids, two strings, intervals.

Minimum Spanning Tree

Connect every node at minimum total cost with Kruskal or Prim.