Data Structures and Algorithms
The most comprehensive interactive DSA guide on the web: 29 core topics with animated visualizers, plain-language walkthroughs, and full implementations in TypeScript, Python, and Go.
Each guide includes: a short video explainer, an interactive step-by-step visualizer, a plain-English walkthrough, comparisons against alternatives, real-world stories, common pitfalls, and a curated LeetCode progression. Built for people who want to actually understand the topic, not just memorize it.
Start Here
Big O Notation Explorer
Before any algorithm, build intuition for how runtime grows with input size. The interactive complexity chart shows what each curve actually feels like at 10, 1k, 1M elements.
Foundations
Core Data Structures
The building blocks every interview and production system rests on. Master these and most algorithms become readable.
6 topics
Array
EasyStructureAn array is a list where each item has a fixed position.
Read by index: O(1), insert/delete in middle: O(n)
Open complete guide →String Processing
EasyStructureA string is text data. Many interview tasks ask you to scan or compare text.
Linear scan: O(n)
Open complete guide →Hash Map / Dictionary
EasyStructureA hash map stores key-value pairs for very fast lookups.
Insert/find average: O(1)
Open complete guide →Stack (LIFO)
EasyStructureA stack is last-in, first-out. Think browser back button history.
Push/pop/top: O(1)
Open complete guide →Queue (FIFO)
EasyStructureA queue is first-in, first-out. Think checkout line behavior.
Enqueue/dequeue: O(1)
Open complete guide →Linked List
MediumStructureA linked list connects nodes with pointers instead of fixed indexes.
Traversal: O(n), insert/delete at node: O(1)
Open complete guide →
Sorting
All the Sorting Algorithms
From the O(n²) classics to the O(n log n) workhorses: every sort you'll be asked about, with side-by-side animated comparisons.
6 topics
Bubble Sort
MediumAlgorithmBubble sort repeatedly compares adjacent pairs and swaps them if they are out of order.
Average/Worst O(n^2), Best O(n) with early-exit optimization
Open complete guide →Selection Sort
EasyAlgorithmSelection sort scans for the smallest remaining value and swaps it into position.
Time O(n^2), Space O(1), Swaps O(n)
Open complete guide →Insertion Sort
MediumAlgorithmInsertion sort grows a sorted section by inserting each new value into the correct position.
Average/Worst O(n^2), Best O(n), Space O(1)
Open complete guide →Merge Sort
HardAlgorithmMerge sort divides data into halves, sorts each half, then merges them back in order.
Time O(n log n), Space O(n)
Open complete guide →Quick Sort
HardAlgorithmQuick sort picks a pivot, partitions values around it, then recursively sorts partitions.
Average O(n log n), Worst O(n^2), Space O(log n) recursion
Open complete guide →Heap Sort
HardAlgorithmHeap sort builds a max-heap, then repeatedly removes the largest value to fill the array from the back.
Time O(n log n) (best/avg/worst), Space O(1)
Open complete guide →
Search & Scan
Searching, Scanning & Linear Patterns
The patterns that turn O(n²) brute force into O(n) or O(log n): binary search, two pointers, sliding windows, and Kadane's classic.
4 topics
Binary Search
MediumAlgorithmBinary search repeatedly halves a sorted search space.
Search: O(log n)
Open complete guide →Two Pointers
MediumAlgorithmTwo pointers move through data from different positions to avoid nested loops.
Typical traversal: O(n)
Open complete guide →Sliding Window
MediumAlgorithmA sliding window keeps a moving subset of data while scanning once.
Typical traversal: O(n)
Open complete guide →Kadane's Algorithm (Maximum Subarray)
MediumAlgorithmKadane's algorithm finds the largest contiguous subarray sum in a single linear pass.
Time O(n), Space O(1)
Open complete guide →
Trees & Graphs
Tree and Graph Traversal
Recursive and queue/stack-based traversal: the foundations behind file systems, dependency resolvers, social graphs, and route planners.
5 topics
Tree Traversal (DFS/BFS)
MediumAlgorithmTraversal means visiting each tree node in a defined order.
Visit all nodes: O(n)
Open complete guide →Breadth-First Search (BFS)
MediumAlgorithmBFS explores a graph layer by layer using a queue, closest nodes first.
Time O(V + E), Space O(V)
Open complete guide →Depth-First Search (DFS)
MediumAlgorithmDFS dives as deep as possible down each branch before backtracking, usually with recursion or a stack.
Time O(V + E), Space O(V) recursion depth
Open complete guide →Depth vs Breadth First Search (DFS/BFS)
HardAlgorithmDepth-first search and breadth-first search are two core ways to traverse connected graphs.
O(V + E)
Open complete guide →Trie (Prefix Tree)
HardStructureA trie stores text so shared prefixes are reused.
Insert/search prefix: O(length of word)
Open complete guide →
Recursion & DP
Recursion, Backtracking & Dynamic Programming
How to break problems into subproblems, decide when to memoize, and recognize the dynamic programming pattern in disguise.
3 topics
Recursive vs Iterative Algorithms
MediumAlgorithmMany algorithm problems can be solved either recursively or iteratively.
Often same time complexity; memory and operational behavior differ
Open complete guide →Backtracking
HardAlgorithmBacktracking tries choices, then undoes them when they fail.
Often exponential in worst case
Open complete guide →Dynamic Programming
HardAlgorithmDP stores subproblem answers so you do not recompute them.
Varies, often reduces exponential to polynomial
Open complete guide →
Advanced
Advanced Structures & Algorithms
The structures and algorithms behind production search, routing, build systems, and competitive programming finals.
5 topics
Heap / Priority Queue
HardStructureA heap quickly gives you the smallest or largest item.
Push/pop: O(log n), peek: O(1)
Open complete guide →Disjoint Set Union (Union-Find)
Extra HardStructureUnion-Find tracks groups of connected items efficiently.
Near O(1) amortized
Open complete guide →Segment Tree
Extra HardStructureSegment tree answers range queries while supporting updates.
Query/update: O(log n)
Open complete guide →Topological Sort
Extra HardAlgorithmTopological sort orders tasks where dependencies must come first.
O(V + E)
Open complete guide →Dijkstra Shortest Path
Extra HardAlgorithmDijkstra finds shortest path from one node when edge weights are non-negative.
O((V + E) log V) with heap
Open complete guide →