Learn algorithms through beautiful animations, step-by-step execution, interactive explanations, and real-world examples.
43 of 43 algorithms
Sorting
Repeatedly swaps adjacent elements that are in the wrong order, bubbling the largest value to the end of each pass.
Sorting
Repeatedly selects the smallest remaining element and moves it to its sorted position at the front.
Sorting
Builds the sorted array one element at a time by inserting each item into its correct place in the sorted sub-array.
Sorting
A classic divide-and-conquer algorithm that recursively divides array in half, sorts halves, and merges them.
Sorting
Picks a pivot element, partitions elements around it, and recursively sorts each sub-array in place.
Sorting
Builds a max-heap from the array, then repeatedly extracts the maximum element to construct the sorted array.
Sorting
A non-comparison sorting algorithm that counts the frequency of each distinct element to compute its exact sorted position in O(n + k) time.
Sorting
Non-comparison algorithm that sorts numbers digit by digit from least significant digit (LSD) to most significant digit (MSD) using stable bucket passes.
Searching
Scans every element sequentially from left to right until target is found or array ends.
Searching
Hunts a sorted array by repeatedly halving search space — the fundamental O(log n) search algorithm.
Searching
Finds the peak of a unimodal function by splitting the search range into three equal parts.
Graphs
Explores a graph or tree by visiting nodes as deeply as possible along each branch before backtracking.
Graphs
Explores a graph level by level using a queue — the go-to for shortest path in unweighted graphs.
Graphs
Finds the shortest path from a starting node to all other nodes in a graph with non-negative edge weights.
Graphs
Grows a minimum spanning tree one vertex at a time, always picking the cheapest connecting edge.
Graphs
Builds a minimum spanning tree by sorting edges and adding the cheapest ones that avoid cycles.
Graphs
Linear ordering of vertices in a Directed Acyclic Graph (DAG) such that for every directed edge u → v, vertex u comes before v.
Graphs
Computes the shortest path between every pair of nodes using dynamic programming on matrices.
Trees
A tree data structure for efficiently storing and retrieving keys in a dataset of strings, ideal for autocomplete.
Trees
Answers range queries (sum, min, max) and supports point updates in logarithmic time.
Trees
A compact binary indexed tree for fast prefix sums and point updates — the BIT.
Trees
A self-balancing binary search tree that keeps height difference at most one with rotations.
Trees
A balanced binary search tree using color rules and rotations — the basis of many standard library maps.
Trees
A binary tree structure where every node’s left child is strictly smaller and right child is strictly larger.
Recursion
Solves the mathematical puzzle of moving a stack of disks across three pegs following strict size constraints in 2ⁿ - 1 moves.
Dynamic Programming
Computes the Nth Fibonacci number, comparing naive recursion O(2ⁿ), memoization O(n), and tabular DP O(n).
Recursion
Generates every ordering of a set by swapping elements and recursing on the remaining suffix.
Dynamic Programming
Selects items with given weights and values to maximize total profit without exceeding a maximum weight capacity W.
Dynamic Programming
Finds the longest sequence of characters appearing in the same relative order within two strings.
Dynamic Programming
Counts the minimum insertions, deletions, or substitutions to turn one string into another.
Dynamic Programming
Computes the minimum number of coins needed to make up a target amount using infinite coin denominations.
Greedy
Selects the maximum number of non-overlapping activities by always picking the earliest finish.
Greedy
Builds an optimal prefix code by merging the two least frequent symbols repeatedly.
Backtracking
Places N chess queens on an N × N chessboard such that no two queens attack each other (same row, column, or diagonal).
Backtracking
Fills empty cells one by one, trying candidates and undoing when a constraint is violated.
Bit Manipulation
Counts the number of set bits (1s) in an integer’s binary representation using Brian Kernighan’s O(k) bitwise trick.
Bit Manipulation
Finds the unique element in an array where every other element appears exactly twice using O(1) space XOR trick.
Trees
Compares two binary trees by the sequence of their leaf values from left to right.
Searching
Efficient string matching algorithm that uses a Prefix Function (LPS array) to avoid re-examining matched characters.
Graphs
Computes single-source shortest paths in weighted graphs and detects negative weight cycles.
Dynamic Programming
Finds the contiguous subarray within a one-dimensional numerical array which has the largest sum in O(N) linear time.
Greedy
Design a Least Recently Used (LRU) Cache data structure supporting O(1) get and put operations using a Doubly Linked List and Hash Map.
Graphs
Finds all Strongly Connected Components (SCCs) in a directed graph using a single DFS traversal and a Stack.
Reading about algorithms only takes you so far. Seeing the data move makes the logic click — and stick.
Watch every comparison, swap, and pointer move as it happens instead of reading about it in a textbook.
Play, pause, and slow down visualizations. See the data transform right before your eyes.
Follow highlighted lines of real code that stay perfectly in sync with the animation frame.
Learn the intuition, complexity trade-offs, and edge cases interviewers actually ask about.
A phased rollout — starting with sorting, then expanding through every major DSA topic.
Understand how elements are arranged: bubble sort and selection sort are live, with insertion, merge, and quick sort next.
Linear, binary, and ternary search with animated array scans.
Recursion trees for classic problems and backtracking foundations.
BSTs, tries, and self-balancing trees with rotations visualized.
DFS, BFS, shortest paths, and minimum spanning trees on live graphs.
Memoization and tabulation for knapsack, LCS, edit distance, and coin change.
Greedy strategies, backtracking puzzles, and bit-manipulation tricks.
Jump straight into the first interactive algorithm — watch every swap and understand why it works.
Start Learning