Skip to main content

Data structures & algorithms

DSA Atlas

Explore concepts as a connected map instead of a flat list. Follow families, see prerequisites, and understand what each topic unlocks next.

New learning track

System design now sits alongside the DSA atlas

If you want to move from algorithmic building blocks into production architecture, start the new system design atlas with a deep dive on designing a rate limiter at scale.

Topics

63

Every topic is linked by family, prerequisites, and what it unlocks.

Families

12

Trees sit under graphs, so conceptual navigation mirrors the underlying theory.

Algorithms

20

Traverse, search, sort, and optimize with clear follow-up suggestions.

Learning paths

17

Curated routes help you move from fundamentals to more specialized topics.

Navigate the DSA atlas

Search, filter, and regroup the atlas without losing context. The current search and filters stay in the URL, so it is easier to revisit the same slice after opening a topic.

Browse by family

Topic type

Tags

Curated learning paths

Focus on a path to shrink the grid to a coherent sequence instead of a flat list.

Weighted shortest paths

8 matching

See the spectrum from plain BFS to deque-based 0-1 BFS to priority-queue shortest paths and dense all-pairs DP.

Linear toolkit

7 matching

Learn how sequence-shaped data unlocks queues, stacks, windows, and fast pointer manipulations.

Ordered structures

9 matching

See how order can come from sorted arrays, search trees, skip lists, disk-friendly indexes, heaps, and prefix trees.

Storage engines

7 matching

Compare fanout-heavy indexes, write-optimized trees, and external-memory sorting in one storage-oriented path.

Range-query toolkit

8 matching

Start with static prefix tricks, then move into offline, persistent, dynamic, and precomputed range-query structures.

Rooted tree queries

10 matching

Flatten subtrees, jump through ancestors, and break tree paths into array segments instead of climbing naively.

String matching

8 matching

Move from prefix reuse and rolling hashes to suffix-based indexing and automata.

Strategy playbook

6 matching

A reusable set of problem-solving moves for brute-force search, greedy choices, memoized state, and advanced DP optimization.

Graph structure

6 matching

Go beyond traversal into SCCs, critical edges, degree structure, and other non-shortest-path graph properties.

Tree path queries

6 matching

Build the full ladder from ancestor queries to heavy-light decomposition and historical segment trees.

Substring toolkit

4 matching

Compare rolling hashes, sorted suffixes, automata, and palindrome-specific structure.

Offline toolkit

5 matching

See how reordering queries, rolling back state, and preserving versions can replace online complexity.

DP optimization

3 matching

Turn transition formulas into line queries and move from hull geometry to dynamic Li Chao trees.

Probabilistic systems

4 matching

Learn how approximate membership, frequency, and cardinality structures trade tiny errors for massive scale.

Cache & distribution

5 matching

Connect local eviction policy with distributed key placement and system-scale cache design.

Database operators

5 matching

See how external sorting and join strategies turn in-memory algorithms into database execution plans.

Topic map

63 topics match the current search and filters, grouped by family.

Group matching topics

Keep the atlas grouped by conceptual families so parent-child relationships stay visible.

Graphs

Nodes, edges, traversal, connectivity, and shortest paths.

13 topics

Graphs Algorithm Intro

BFS — Breadth-First Search

Explore a graph level by level using a queue. BFS finds the shortest path in unweighted graphs and is fundamental to many graph algorithms.

Builds on

Graph Fundamentals, Queue

Unlocks

0-1 BFS, Dijkstra's Algorithm, Minimum Spanning Tree +1 more

graphsbfsshortest-pathqueue
Graphs Algorithm Intro

DFS — Depth-First Search

Dive as deep as possible before backtracking. DFS is essential for detecting cycles, topological sorting, and exploring all paths in a graph.

Builds on

Graph Fundamentals, Stack & Monotonic Stack

Unlocks

Topological Sort, Bridges and Articulation Points, Eulerian Path +5 more

graphsdfstreerecursionstack
Graphs Concept Intro

Graph Fundamentals

Learn the core language of nodes, edges, paths, and cycles. Graphs are the broad container that trees, BFS, DFS, Dijkstra, and MST all live inside.

Start here

Foundational enough to read on its own.

Unlocks

BFS — Breadth-First Search, DFS — Depth-First Search, 0-1 BFS +9 more

graphsgraph-theorytraversalconnected-components
Graphs Algorithm Intermediate

0-1 BFS

Find shortest paths in graphs whose edge weights are only 0 or 1 using a deque instead of a heap.

Builds on

BFS — Breadth-First Search, Graph Fundamentals, Deque (Double-Ended Queue)

graphsshortest-pathdequerare
Graphs Algorithm Intermediate

Dijkstra's Algorithm

Find the shortest path in weighted graphs with non-negative edges. Dijkstra is BFS with a priority queue — it processes nodes in order of cumulative distance.

Builds on

BFS — Breadth-First Search, Graph Fundamentals, Heap & Priority Queue +1 more

graphsshortest-pathgreedypriority-queue
Graphs Algorithm Intermediate

Minimum Spanning Tree

Find the subset of edges that connects all vertices with minimum total weight. Kruskal's and Prim's are the two classic approaches.

Builds on

Graph Fundamentals, Union-Find (Disjoint Set), Heap & Priority Queue +1 more

graphsgreedymstunion-find
Graphs Algorithm Intermediate

Topological Sort

Order the nodes of a DAG so that every edge points forward. Essential for dependency resolution, build systems, and scheduling.

Builds on

DFS — Depth-First Search, Graph Fundamentals

graphsdfsdagtopological-sort
Graphs Data structure Intermediate

Union-Find (Disjoint Set)

Track connected components efficiently with near-constant time union and find operations. The backbone of Kruskal's MST and dynamic connectivity.

Builds on

Graph Fundamentals

Unlocks

Minimum Spanning Tree, DSU Rollback

graphsunion-findtreeconnected-components
Graphs Algorithm Advanced

Bridges and Articulation Points

Use DFS timestamps and low-link values to find the edges and vertices whose removal disconnects an undirected graph.

Builds on

DFS — Depth-First Search, Graph Fundamentals

graphsbridgesarticulation-pointsrare
Graphs Data structure Advanced

DSU Rollback

Add an undo stack to Union-Find so merges can be reversed during offline divide-and-conquer or time-travel style processing.

Builds on

Union-Find (Disjoint Set)

union-findrollbackrare
Graphs Algorithm Advanced

Eulerian Path

Traverse every edge exactly once by checking degree conditions and then building the walk with Hierholzer's algorithm.

Builds on

DFS — Depth-First Search, Graph Fundamentals

graphspathsstackconnectivity
Graphs Algorithm Advanced

Floyd-Warshall

Compute all-pairs shortest paths by gradually allowing more intermediate vertices. This is the clean dynamic-programming answer to dense shortest-path queries.

Builds on

Graph Fundamentals, Dynamic Programming

graphsshortest-pathdynamic-programming
Graphs Algorithm Advanced

Tarjan SCC

Find strongly connected components in one DFS by tracking discovery times, low-link values, and the active stack.

Builds on

DFS — Depth-First Search, Graph Fundamentals

graphsscclow-linkrare

Trees

Special case of Graphs

Hierarchies and constrained graphs. A tree is a connected acyclic graph.

8 topics

Trees Concept Intro

Tree Fundamentals

Understand roots, parents, children, depth, height, and traversal orders. A tree is a graph with enough structure to make many problems much simpler.

Trees is a special case of Graphs.

Builds on

Graph Fundamentals

Unlocks

Binary Search Tree (BST), Heap & Priority Queue, Binary Lifting +10 more

treegraphsbfsdfsrecursion
Trees Data structure Intermediate

Binary Search Tree (BST)

A sorted tree structure enabling O(log n) search, insert, and delete. Foundation for balanced trees, sets, and maps.

Trees is a special case of Graphs.

Builds on

Tree Fundamentals, Binary Search

Unlocks

Treap, B-Tree, B+ Tree +1 more

treebstbinary-searchrecursion
Trees Data structure Intermediate

Heap & Priority Queue

A complete binary tree where every parent is smaller (or larger) than its children. The backbone of Dijkstra, event scheduling, and top-k problems.

Trees is a special case of Graphs.

Builds on

Tree Fundamentals

Unlocks

Dijkstra's Algorithm, Minimum Spanning Tree, Treap +1 more

heappriority-queuetreesortingarray
Trees Technique Advanced

Binary Lifting

Jump upward in a rooted tree by powers of two to answer k-th ancestor and many LCA-style queries quickly.

Trees is a special case of Graphs.

Builds on

Tree Fundamentals

Unlocks

Lowest Common Ancestor

treedoublinglcarare
Trees Technique Advanced

Euler Tour Technique

Flatten a rooted tree into an array so subtree problems become range problems. This is the bridge between trees and range-query structures.

Trees is a special case of Graphs.

Builds on

DFS — Depth-First Search, Tree Fundamentals

Unlocks

Binary Lifting, Heavy-Light Decomposition, Lowest Common Ancestor

treedfsrange-queryrare
Trees Technique Advanced

Heavy-Light Decomposition

Break tree paths into O(log n) heavy-chain segments so path queries can ride on top of a segment tree instead of walking edge by edge.

Trees is a special case of Graphs.

Builds on

DFS — Depth-First Search, Tree Fundamentals, Lowest Common Ancestor +1 more

Unlocks

Persistent Segment Tree

treepath-queriessegment-treerare
Trees Algorithm Advanced

Lowest Common Ancestor

Find the deepest shared ancestor of two nodes in a rooted tree. LCA is a core tree-query problem that ties together DFS, binary lifting, and Euler tours.

Trees is a special case of Graphs.

Builds on

DFS — Depth-First Search, Tree Fundamentals

Unlocks

Heavy-Light Decomposition

treelcaqueriesbinary-lifting
Trees Data structure Advanced

Treap

Combine binary-search-tree ordering with heap priorities to get a balanced randomized tree with elegant split and merge operations.

Trees is a special case of Graphs.

Builds on

Tree Fundamentals, Binary Search Tree (BST), Heap & Priority Queue

treebstrandomizedrare

Range queries

Static and dynamic range aggregates via indexed trees, segment trees, and precomputed tables.

8 topics

Range queries Technique Intro

Prefix Sum

Precompute cumulative totals so any range sum becomes one subtraction. Prefix sums are the first serious range-query idea everyone should know.

Start here

Foundational enough to read on its own.

Unlocks

Difference Array, Fenwick Tree (Binary Indexed Tree), Mo's Algorithm +2 more

prefix-sumrange-queryprecomputationarray
Range queries Technique Intermediate

Difference Array

Apply many range updates in O(1) each, then rebuild the final values with one prefix pass. Difference arrays are the update-side twin of prefix sums.

Builds on

Prefix Sum

Unlocks

Fenwick Tree (Binary Indexed Tree), Segment Tree

difference-arrayrange-updateprefix-sumarray
Range queries Data structure Intermediate

Fenwick Tree (Binary Indexed Tree)

Maintain prefix sums with O(log n) updates and queries using one tiny bit trick. Fenwick trees are the lightest dynamic range-query structure worth knowing.

Builds on

Prefix Sum

Unlocks

Euler Tour Technique

fenwick-treerange-queryprefix-sumrare
Range queries Data structure Advanced

Li Chao Tree

Maintain dynamic line insertion and min/max queries by storing line candidates in a segment tree over x-values.

Builds on

Segment Tree, Convex Hull Trick

linesrange-queryrare
Range queries Technique Advanced

Mo's Algorithm

Reorder offline range queries so a moving window can answer them with small pointer adjustments instead of rebuilding from scratch.

Builds on

Prefix Sum

range-queryofflinerare
Range queries Data structure Advanced

Persistent Segment Tree

Keep every version of a segment tree by path-copying only the changed nodes.

Builds on

Segment Tree

segment-treepersistencerare
Range queries Data structure Advanced

Segment Tree

Answer range queries and point updates in O(log n). Segment trees are the go-to structure for range sum, range min, and similar problems.

Builds on

Tree Fundamentals, Prefix Sum

Unlocks

Euler Tour Technique, Heavy-Light Decomposition, Li Chao Tree +1 more

segment-treetreerange-querydivide-and-conquer
Range queries Data structure Advanced

Sparse Table

Answer static range minima, maxima, or gcd queries in O(1) after O(n log n) preprocessing. Sparse tables are pure precomputation power.

Builds on

Prefix Sum

sparse-tablerange-queryidempotentrare

Linear structures

State that flows from one end to the other: lists, deques, stacks, and windows.

6 topics

Linear structures Data structure Intro

Deque (Double-Ended Queue)

Push and pop from both ends in O(1). A deque can behave like a queue, a stack, or a monotonic window depending on how you use it.

Builds on

Queue

Unlocks

BFS — Breadth-First Search, 0-1 BFS, Stack & Monotonic Stack +2 more

dequequeuestacklinked-listsliding-window
Linear structures Data structure Intro

Linked List Operations

Reverse, detect cycles, merge sorted lists. Linked lists test your pointer manipulation skills — every operation is about rewiring next pointers.

Start here

Foundational enough to read on its own.

Unlocks

Deque (Double-Ended Queue), Queue, Stack & Monotonic Stack +3 more

linked-listtwo-pointersrecursion
Linear structures Data structure Intro

Queue

Process work in first-in, first-out order. Queues are the missing linear-structure foundation behind BFS, buffering, and fair scheduling.

Start here

Foundational enough to read on its own.

Unlocks

BFS — Breadth-First Search, Deque (Double-Ended Queue), Monotonic Queue

queuefifobfslinear
Linear structures Data structure Intro

Stack & Monotonic Stack

LIFO data structure for expression evaluation, backtracking state, and the powerful monotonic stack pattern for next-greater-element problems.

Start here

Foundational enough to read on its own.

Unlocks

DFS — Depth-First Search, Eulerian Path, Backtracking

stackmonotonic-stackarray
Linear structures Technique Intro

Two Pointers & Sliding Window

Shrink O(n²) brute force to O(n) by maintaining a window or two converging pointers. The go-to technique for subarray and subsequence problems.

Start here

Foundational enough to read on its own.

Unlocks

Monotonic Queue

arraytwo-pointerssliding-window
Linear structures Technique Intermediate

Monotonic Queue

Maintain sliding-window candidates in sorted order inside a deque so each window maximum or minimum is available in O(1).

Builds on

Deque (Double-Ended Queue), Queue, Two Pointers & Sliding Window

Unlocks

Dynamic Programming

monotonic-queuedequesliding-windowarray

Search

Monotonic predicates, ordered data, and pruning search space aggressively.

1 topic

Sorting

Partition, merge, and reorder data so later operations become easier.

2 topics

Problem-solving strategies

Reusable paradigms like greedy choice, backtracking, and dynamic programming.

4 topics

Strings

Prefix-aware structures and text-centric search strategies.

8 topics

Strings Algorithm Intermediate

KMP (Knuth-Morris-Pratt)

Search for a pattern in linear time by reusing information about its own prefixes instead of restarting after mismatches.

Start here

Foundational enough to read on its own.

Unlocks

Aho-Corasick, Suffix Array

stringpattern-matchingprefix-functionkmp
Strings Algorithm Intermediate

Rabin-Karp

Search with rolling hashes so most windows can be rejected with arithmetic instead of full character comparisons.

Start here

Foundational enough to read on its own.

Unlocks

Suffix Array

stringrolling-hashpattern-matching
Strings Data structure Intermediate

Trie (Prefix Tree)

A tree-like data structure for efficient string storage and prefix-based retrieval. Essential for autocomplete, spell checking, and word search problems.

Builds on

Tree Fundamentals

Unlocks

Aho-Corasick

triestringtreeprefix
Strings Algorithm Intermediate

Z-Algorithm

Compute how much of the global prefix matches at every position, then reuse the active Z-box to stay linear.

Start here

Foundational enough to read on its own.

Unlocks

Manacher

stringpattern-matchingz-algorithmprefix
Strings Algorithm Advanced

Aho-Corasick

Match many patterns in one pass by augmenting a trie with failure links. This is multi-pattern search done at scale.

Builds on

Trie (Prefix Tree)

stringtriepattern-matchingrare
Strings Algorithm Advanced

Manacher

Find the longest palindromic substring in linear time by reusing information from the rightmost known palindrome.

Start here

Foundational enough to read on its own.

stringpalindromerare
Strings Data structure Advanced

Suffix Array

Sort all suffixes of a string once, then answer many substring questions by binary searching the sorted order.

Builds on

Binary Search

stringsuffix-arrayrare
Strings Data structure Advanced

Suffix Automaton

Compress all substrings of a string into a linear-size automaton with suffix links.

Start here

Foundational enough to read on its own.

stringautomatonrare

Lookup & hashing

Fast membership tests, key/value indexing, and amortized constant-time access.

1 topic

Systems & storage

Database indexes, cache policies, query operators, sharding, and external-memory algorithms.

8 topics

Systems & storage Data structure Advanced

B-Tree

Store many keys per node so ordered search stays shallow and expensive page reads stay low.

Builds on

Tree Fundamentals, Binary Search

Unlocks

B+ Tree

b-treedatabaseindexsearch
Systems & storage Data structure Advanced

B+ Tree

Keep routing keys in internal nodes and all records in linked leaves so point lookups stay shallow and range scans stay fast.

Builds on

B-Tree

b-plus-treedatabaseindexrange-scan
Systems & storage Technique Advanced

Cache Eviction Strategies (LRU, LFU, ARC, TinyLFU)

Treat cache eviction as an algorithm choice: recency, frequency, adaptation, and admission all optimize different workloads.

Builds on

Linked List Operations, Hash Map

cachelrulfutinylfu
Systems & storage Technique Advanced

Consistent Hashing

Map keys onto a ring so cluster membership changes move only nearby keys instead of reshuffling the whole keyspace.

Builds on

Hash Map

distributedhashingcacherare
Systems & storage Algorithm Advanced

External Merge Sort

Sort data larger than RAM by generating sorted runs and merging them with mostly sequential disk I/O.

Builds on

Heap & Priority Queue, Merge Sort

Unlocks

Hash Join & Merge Join

sortingdiskdatabaserare
Systems & storage Algorithm Advanced

Hash Join & Merge Join

Compare the two most important database join strategies: build-and-probe hashing versus ordered merge scanning.

Builds on

Merge Sort, Hash Map

databasejoinhashingsorting
Systems & storage Data structure Advanced

LSM Tree

Trade read complexity for write throughput by buffering writes in memory, flushing sorted runs, and compacting them in the background.

Builds on

Merge Sort, Skip List

lsm-treestoragedatabaserare
Systems & storage Data structure Advanced

Skip List

Layer multiple forward-pointer lists on top of each other so ordered search behaves like a randomized tree while staying list-based.

Builds on

Linked List Operations, Binary Search

Unlocks

LSM Tree

skip-listordered-setsearch

Probabilistic systems

Special case of Systems & storage

Approximate membership, cardinality, and frequency structures for high-volume systems.

3 topics

Bitwise

Compact state, masks, parity tricks, and low-level arithmetic.

1 topic