DSA Visualizer

Step-by-step, replayable visualizations of algorithms and data structures. Pick a card to open its player; visualizers that are not shipped yet show a coming soon state.

Step-by-step playbackStep forward and backSpeed presetsKeyboard shortcutsAudio cuesReduced motion support

179 of 181 visualizers ready to play.

Basic Algorithms

Foundational algorithms and data structures with small inputs and shared renderer patterns. 53 of 53 ready to play.

Bubble Sort

Available

Repeatedly swaps adjacent out-of-order pairs until the array is sorted.

Basic Algorithmsdom rendererTime O(n^2)Space O(1)

Selection Sort

Available

Picks the smallest remaining element and places it at the front.

Basic Algorithmsdom rendererTime O(n^2)Space O(1)

Insertion Sort

Available

Builds the sorted prefix by inserting each element into place.

Basic Algorithmsdom rendererTime O(n^2)Space O(1)

Merge Sort

Available

Divide and conquer: split, sort, then merge sorted halves.

Basic Algorithmssvg rendererTime O(n log n)Space O(n)

Quick Sort

Available

Partitions around a pivot and recurses on each side.

Basic Algorithmssvg rendererTime O(n log n)Space O(log n)

Heap Sort

Available

Builds a max heap, then extracts the largest element repeatedly.

Basic Algorithmssvg rendererTime O(n log n)Space O(1)

Linear Search

Available

Scans elements one by one until the target is found.

Basic Algorithmsdom rendererTime O(n)Space O(1)

Binary Search

Available

Halves the search range on a sorted array each step.

Basic Algorithmssvg rendererTime O(log n)Space O(1)

Stack Operations

Available

Push and pop on a LIFO stack with top tracking.

Basic Algorithmsdom rendererTime O(1) per opSpace O(n)

Queue Operations

Available

Enqueue and dequeue on a FIFO queue with head and tail.

Basic Algorithmsdom rendererTime O(1) per opSpace O(n)

Linked List Reverse

Available

Flips node next pointers in place in one pass.

Basic Algorithmssvg rendererTime O(n)Space O(1)

Binary Tree Traversal

Available

Preorder, inorder, and postorder walks of a binary tree.

Basic Algorithmssvg rendererTime O(n)Space O(h)

BST Operations

Available

Search, insert, and delete in a binary search tree.

Basic Algorithmssvg rendererTime O(log n)Space O(n)

Min Heap Operations

Available

Insert and extract-min while sifting to restore heap order.

Basic Algorithmssvg rendererTime O(log n)Space O(n)

Graph BFS

Available

Level-by-level exploration of a graph from a source node.

Basic Algorithmssvg rendererTime O(V + E)Space O(V)

Graph DFS

Available

Depth-first exploration that backtracks when stuck.

Basic Algorithmssvg rendererTime O(V + E)Space O(V)

Dijkstra

Available

Shortest paths from a source with a priority queue.

Basic Algorithmssvg rendererTime O((V + E) log V)Space O(V)

Topological Sort

Available

Orders DAG nodes so every edge points forward.

Basic Algorithmssvg rendererTime O(V + E)Space O(V)

Kadane Max Subarray

Available

Tracks the best contiguous sum in one pass.

Basic Algorithmsdom rendererTime O(n)Space O(1)

Sliding Window Maximum

Available

Maintains the maximum of each fixed-size window.

Basic Algorithmsdom rendererTime O(n)Space O(k)

Fibonacci DP

Available

Memoized recursion and a bottom-up table for Fibonacci numbers.

Basic Algorithmssvg rendererTime O(n)Space O(n)

Number of Islands

Available

Counts connected groups of land cells in a grid.

Basic Algorithmscanvas rendererTime O(R x C)Space O(R x C)

Trie Insert and Search

Available

Inserts and searches words through shared prefixes.

Basic Algorithmssvg rendererTime O(L) per opSpace O(total chars)

Union Find Operations

Available

Union and find with path compression on disjoint sets.

Basic Algorithmssvg rendererTime O(α(n))Space O(n)

N Queens

Available

Places n queens so none attack each other, with backtracking.

Basic Algorithmscanvas rendererTime O(n!)Space O(n)

Sieve of Eratosthenes

Available

Marks multiples step by step to find all primes.

Basic Algorithmsdom rendererTime O(n log log n)Space O(n)

Binary Exponentiation

Available

Computes powers in O(log n) by repeated squaring.

Basic Algorithmsdom rendererTime O(log n)Space O(1)

Euclidean GCD

Available

Repeatedly subtracts or mods until the remainder is zero.

Basic Algorithmsdom rendererTime O(log min(a, b))Space O(1)

Rabin-Karp Hashing

Available

Pattern matching with rolling hash fingerprints.

Basic Algorithmsdom rendererTime O(n + m)Space O(1)

Ternary Search

Available

Finds the peak of a unimodal function.

Basic Algorithmscanvas rendererTime O(log n)Space O(1)

Josephus Problem

Available

Eliminates every k-th person in a circle.

Basic Algorithmsdom rendererTime O(n^2)Space O(n)

Gray Code

Available

Cycles through bitmasks changing one bit at a time.

Basic Algorithmsdom rendererTime O(2^n)Space O(2^n)

Bit Manipulation

Available

Bitwise tricks: isolation, counting, toggling.

Basic Algorithmsdom rendererTime O(bits)Space O(1)

Inclusion-Exclusion

Available

Counts unions by alternating intersection terms.

Basic Algorithmsdom rendererTime O(k * 2^k)Space O(1)

Catalan Numbers

Available

Counts balanced parenthesizations and binary trees.

Basic Algorithmsdom rendererTime O(n^2)Space O(n)

Pascal Triangle Binomials

Available

Builds binomial coefficients row by row.

Basic Algorithmssvg rendererTime O(n^2)Space O(n^2)

K-th Order Statistic

Available

Quickselect pivoting finds the k-th element.

Basic Algorithmsdom rendererTime O(n) averageSpace O(1)

MEX of a Sequence

Available

Finds the smallest non-negative missing integer.

Basic Algorithmsdom rendererTime O(n)Space O(n)

Next Permutation

Available

Rearranges to the next lexicographic permutation.

Basic Algorithmsdom rendererTime O(n)Space O(1)

Cyclic Sort

Available

Places each value at its index in cycles.

Basic Algorithmsdom rendererTime O(n)Space O(1)

Euler Totient Phi

Available

Counts integers coprime to n up to n.

Basic Algorithmsdom rendererTime O(sqrt n)Space O(1)

Linear Sieve

Available

Computes primes and smallest factors in linear time.

Basic Algorithmsdom rendererTime O(n)Space O(n)

Modular Inverse

Available

Finds x with a*x = 1 mod m via extended Euclid.

Basic Algorithmsdom rendererTime O(log min(a, m))Space O(1)

Chinese Remainder Theorem

Available

Combines modular congruences into one answer.

Basic Algorithmsdom rendererTime O(n log m)Space O(n)

Prime Factorization

Available

Splits a number into its prime factors.

Basic Algorithmsdom rendererTime O(sqrt n)Space O(log n)

Balanced Bracket Sequences

Available

Stack push-pop verifies balanced parentheses.

Basic Algorithmsdom rendererTime O(n)Space O(n)

String Hashing

Available

Rolling polynomial hashes for substring equality.

Basic Algorithmsdom rendererTime O(n + m)Space O(n)

Job Scheduling

Available

Greedy job ordering on a single machine.

Basic Algorithmsdom rendererTime O(n log n)Space O(n)

Array Rotation

Available

Shifts elements around an array in place.

Basic Algorithmsdom rendererTime O(n)Space O(1)

Stars and Bars

Available

Distributes identical items into distinct bins.

Basic Algorithmsdom rendererTime O(n + k)Space O(n + k)

Two Machine Scheduling

Available

Partitions jobs to balance two machines.

Basic Algorithmsdom rendererTime O(n log n)Space O(n)

Schedule with Deadlines

Available

Orders unit jobs by deadline for max completion.

Basic Algorithmsdom rendererTime O(n log n)Space O(n)

Submask Enumeration

Available

Iterates all submasks of a mask.

Basic Algorithmsdom rendererTime O(2^k)Space O(k)

Algorithm Patterns

Interview-pattern algorithms: two pointers, sliding window, DP tables, and classic graph patterns. 41 of 43 ready to play.

Two Pointer Sum

Available

Finds a pair with a target sum by closing in from both ends.

Algorithm Patternsdom rendererTime O(n)Space O(1)

Container With Most Water

Available

Two pointers choose the widest pair of tall walls.

Algorithm Patternscanvas rendererTime O(n)Space O(1)

Fast Slow Pointer

Available

Detects cycles with tortoise and hare pointers.

Algorithm Patternssvg rendererTime O(n)Space O(1)

Monotonic Stack

Available

Maintains a stack of increasing or decreasing values.

Algorithm Patternsdom rendererTime O(n)Space O(n)

Prefix Sum

Available

Precomputes range sums for instant queries.

Algorithm Patternsdom rendererTime O(n)Space O(n)

Knapsack 0-1

Available

Picks items with maximum value under a weight capacity.

Algorithm Patternscanvas rendererTime O(n * capacity)Space O(n * capacity)

Coin Change

Available

Finds the fewest reusable coins for an amount and reconstructs one optimal combination.

Algorithm Patternssvg rendererTime O(amount * coins)Space O(amount)

Longest Common Subsequence

Available

Longest common subsequence via a DP table.

Algorithm Patternscanvas rendererTime O(n*m)Space O(n*m)

Longest Increasing Subsequence

Available

Longest increasing subsequence with a DP or patience table.

Algorithm Patternscanvas rendererTime O(n^2)Space O(n^2)

Subsets and Permutations

Available

Enumerates subsets and permutations with recursion trees.

Algorithm Patternssvg rendererTime O(2^n + n!)Space O(n)

Kruskal MST

Available

Adds the cheapest safe edge until the tree spans all nodes.

Algorithm Patternssvg rendererTime O(E log E)Space O(V + E)

Prim MST

Available

Grows a minimum spanning tree from a seed node.

Algorithm Patternssvg rendererTime O(E log V)Space O(V + E)

A Star Grid

Available

Grid pathfinding with a heuristic-guided frontier.

Algorithm Patternscanvas rendererTime O(cells log cells)Space O(cells)

Sorting Comparison Lab

Available

Compares step counts and patterns across sort algorithms.

Algorithm Patternscanvas rendererTime O(n^2) vs O(n log n)Space O(1)

Matrix Exponentiation

Available

Fast linear recurrences by repeated matrix squaring.

Algorithm Patternscanvas rendererTime O(m^3 log n)Space O(m^2)

Digit DP

Available

Counts numbers digit by digit with tight bounds.

Algorithm Patternssvg rendererTime O(n * S)Space O(n * S)

Bitmask DP

Available

Subset DP over bitmasks of small state sets.

Algorithm Patternssvg rendererTime O(n^2 * 2^n)Space O(n * 2^n)

Interval DP

Available

Merges intervals left to right while combining costs.

Algorithm Patternssvg rendererTime O(n^3)Space O(n^2)

Tree Diameter

Available

Two BFS sweeps find the longest tree path.

Algorithm Patternssvg rendererTime O(V)Space O(V)

Euler Tour

Available

Flattens a tree into an array via DFS entry-exit times.

Algorithm Patternssvg rendererTime O(n)Space O(n)

Functional Graphs

Available

Each node points to one target; finds cycles.

Algorithm Patternssvg rendererTime O(n)Space O(n)

Cycle Detection

Available

DFS timestamps reveal cycles and their members.

Algorithm Patternssvg rendererTime O(V + E)Space O(V)

Difference Array

Available

Range adds applied at endpoints, then prefix sums.

Algorithm Patternsdom rendererTime O(n + k)Space O(n)

Multi-Source BFS

Available

Expands from many sources simultaneously.

Algorithm Patternssvg rendererTime O(rows x cols)Space O(rows x cols)

Bidirectional BFS

Available

Meets in the middle with two expanding frontiers.

Algorithm Patternssvg rendererTime O(V + E)Space O(V)

Meet in the Middle

Available

Splits the search space in half and combines.

Algorithm Patternsdom rendererTime O(2^(n/2) log 2^(n/2))Space O(2^(n/2))

Expression Parsing

Available

Converts infix to postfix and evaluates.

Algorithm Patternssvg rendererTime O(n)Space O(n)

2D Prefix Sum

Available

Precomputes rectangle sums on a 2D grid.

Algorithm Patternscanvas rendererTime O(R*C)Space O(R*C)

Monotonic Queue

Available

Maintains a sliding window min or max.

Algorithm Patternsdom rendererTime O(n)Space O(k)

LRU Cache

Available

Evicts the least recently used entry on capacity.

Algorithm Patternsdom rendererTime O(1) per opSpace O(capacity)

Two Heaps

Available

Keeps medians with a min and max heap.

Algorithm Patternssvg rendererTime O(n log n)Space O(n)

K-Way Merge

Available

Merges k sorted lists with a min heap.

Algorithm Patternssvg rendererTime O(n log k)Space O(n + k)

Trapping Rainwater

Available

Accumulates water above elevations between walls.

Algorithm Patternsdom rendererTime O(n)Space O(1)

Stock Trading DP

Available

DP over days, holding states, and transactions.

Algorithm Patternscanvas rendererTime O(n k)Space O(n k)

Grid DP

Available

Paths through a grid with obstacle constraints.

Algorithm Patternssvg rendererTime O(R*C)Space O(R*C)

Lattice Paths

Available

Counts monotone grid paths combinatorially.

Algorithm Patternssvg rendererTime O(R*C)Space O(R*C)

Matrix Chain Multiplication

Available

Orders matrix multiplications to minimize cost.

Algorithm Patternssvg rendererTime O(n^3)Space O(n^2)

Graph Coloring / Bipartite Check

Available

Two-colors components to test bipartiteness.

Algorithm Patternssvg rendererTime O(V + E)Space O(V)

XOR Basis

Available

Linear basis of bitsets over GF(2).

Algorithm Patternsdom rendererTime O(n * 6)Space O(6)

15 Puzzle

Available

Sliding tiles; parity decides solvability.

Algorithm Patternssvg rendererTime O(b^d)Space O(b^d)

Largest Zero Submatrix

Available

Histogram trick finds the largest zero rectangle.

Algorithm Patternscanvas rendererTime O(rows * cols)Space O(cols)

Tree from Traversals

Coming soon

Rebuilds a tree from its traversals.

Algorithm Patternssvg renderer

Trie XOR Max Pair

Coming soon

Binary trie finds the max XOR pair.

Algorithm Patternssvg renderer

Advanced Competitive Programming

Competitive-programming depth: flows, string algorithms, geometry, and advanced data structures. 85 of 85 ready to play.

Bellman Ford

Available

Relaxes all edges repeatedly to find shortest paths.

Advanced Competitive Programmingsvg rendererTime O(V * E)Space O(V)

Floyd Warshall

Available

All-pairs shortest paths through intermediate nodes.

Advanced Competitive Programmingcanvas rendererTime O(n^3)Space O(n^2)

Max Flow Dinic

Available

Augments blocking flows through a level graph.

Advanced Competitive Programmingsvg rendererTime O(V^2 E)Space O(V + E)

SCC Tarjan

Available

Finds strongly connected components with one DFS.

Advanced Competitive Programmingsvg rendererTime O(V + E)Space O(V)

Bipartite Matching

Available

Matches left and right nodes with augmenting paths.

Advanced Competitive Programmingsvg rendererTime O(V * E)Space O(V + E)

Bridges and Articulation

Available

Finds edges and nodes whose removal disconnects the graph.

Advanced Competitive Programmingsvg rendererTime O(V + E)Space O(V)

KMP String Matching

Available

Linear pattern search using the failure table.

Advanced Competitive Programmingsvg rendererTime O(n + m)Space O(m)

Z Function

Available

Computes longest common prefix lengths for every position.

Advanced Competitive Programmingdom rendererTime O(n)Space O(n)

Convex Hull Graham

Available

Builds the convex hull with a monotonic chain scan.

Advanced Competitive Programmingsvg rendererTime O(n log n)Space O(n)

Sparse Table RMQ

Available

Answers range minimum queries in O(1) after an O(n log n) build.

Advanced Competitive Programmingdom rendererTime O(n log n) build, O(1) querySpace O(n log n)

Minimax Game

Available

Solves perfect-information games with the minimax tree.

Advanced Competitive Programmingsvg rendererTime O(b^d)Space O(d)

Euler Path

Available

Finds a trail visiting every edge exactly once.

Advanced Competitive Programmingsvg rendererTime O(V + E)Space O(V + E)

Segment Tree

Available

Point updates and range queries in O(log n).

Advanced Competitive Programmingsvg rendererTime O(log n)Space O(n)

Fenwick Tree

Available

Prefix sums and point updates with a binary indexed tree.

Advanced Competitive Programmingsvg rendererTime O(log n) per operationSpace O(n)

0-1 BFS

Available

Shortest paths on graphs with 0-1 edge weights via deque.

Advanced Competitive Programmingsvg rendererTime O(V + E)Space O(V)

Edmonds-Karp Max Flow

Available

Finds max flow with BFS-based augmenting paths.

Advanced Competitive Programmingcanvas rendererTime O(V E^2)Space O(V + E)

Aho-Corasick

Available

Multi-pattern search on a trie with failure links.

Advanced Competitive Programmingsvg rendererTime O(n + m + z)Space O(m)

Manacher Palindrome

Available

Finds all palindromic substrings in linear time.

Advanced Competitive Programmingdom rendererTime O(n)Space O(n)

Suffix Array

Available

Sorted suffixes built with doubling or SA-IS.

Advanced Competitive Programmingsvg rendererTime O(n log n)Space O(n)

Sqrt Decomposition

Available

Splits an array into blocks for fast range queries.

Advanced Competitive Programmingsvg rendererTime O(sqrt(n)) per operationSpace O(n)

Treap

Available

Randomized BST with heap priorities.

Advanced Competitive Programmingsvg rendererTime O(log n)Space O(n)

LCA Binary Lifting

Available

Ancestor jumps of powers of two answer LCA queries.

Advanced Competitive Programmingsvg rendererTime O(log n)Space O(n log n)

2-SAT

Available

Satisfiability of 2-CNF clauses via implication graph.

Advanced Competitive Programmingsvg rendererTime O(n + k)Space O(n + k)

Min Cost Flow

Available

Successive shortest paths for minimum cost flow.

Advanced Competitive Programmingcanvas rendererTime O(F V E)Space O(V + E)

Hungarian Assignment

Available

Optimal assignment in O(n^3) with alternating paths.

Advanced Competitive Programmingcanvas rendererTime O(n^3)Space O(n^2)

Heavy Light Decomposition

Available

Splits trees into heavy paths for log-n queries.

Advanced Competitive Programmingsvg rendererTime O(log n) chains per pathSpace O(n)

Centroid Decomposition

Available

Recursively decomposes a tree at centroids.

Advanced Competitive Programmingsvg rendererTime O(n log n)Space O(n)

Mo's Algorithm

Available

Answers range queries by clever reordering.

Advanced Competitive Programmingsvg rendererTime O((N + Q) sqrt(N))Space O(N)

Stoer-Wagner Min Cut

Available

Global min cut by repeated maximum adjacency phases.

Advanced Competitive Programmingsvg rendererTime O(n^3)Space O(n^2)

Push-Relabel Max Flow

Available

Pushes excess along admissible edges; relabels sinks.

Advanced Competitive Programmingsvg rendererTime O(V^2 E)Space O(V + E)

Prufer Code

Available

Encodes trees as sequences and back.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)

Polygon Area

Available

Shoelace sums cross products around a polygon.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(1)

Point in Polygon

Available

Ray casting tests containment in a polygon.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(1)

Segment Intersection

Available

Orientation tests decide segment crossings.

Advanced Competitive Programmingsvg rendererTime O(n^2)Space O(n)

Circle-Line Intersection

Available

Projects the line to find circle chord points.

Advanced Competitive Programmingsvg rendererTime O(1)Space O(1)

Circle-Circle Intersection

Available

Radical axis solves the two circle overlap.

Advanced Competitive Programmingsvg rendererTime O(1)Space O(1)

Line Intersection

Available

Cramer's rule finds the line crossing point.

Advanced Competitive Programmingsvg rendererTime O(1)Space O(1)

Manhattan Distance

Available

L1 geometry: circles become diamonds.

Advanced Competitive Programmingsvg rendererTime O(n^2)Space O(n)

Closest Pair of Points

Available

Sweep and strip search finds the closest pair.

Advanced Competitive Programmingsvg rendererTime O(n log n)Space O(n)

Line Sweep

Available

Event-sorted sweep over segment endpoints.

Advanced Competitive Programmingsvg rendererTime O(n log n)Space O(n)

Convex Hull Trick

Available

Lines queried for max or min at x.

Advanced Competitive Programmingsvg rendererTime O(n log n)Space O(n)

Minimum Enclosing Circle

Available

Randomized incremental smallest circle.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)

Half-Plane Intersection

Available

Intersects half-planes with angular sorting.

Advanced Competitive Programmingsvg rendererTime O(n*m)Space O(m)

Minkowski Sum

Available

Adds convex polygons edge by edge.

Advanced Competitive Programmingsvg rendererTime O(n + m)Space O(n + m)

Rotating Calipers

Available

Rotates parallel support lines around a hull.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)

Pick's Theorem

Available

Relates area, interior, and boundary lattice points.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)

Delaunay Voronoi

Available

Triangulates points; dual is the Voronoi diagram.

Advanced Competitive Programmingsvg rendererTime O(n²)Space O(n²)

Point Location

Available

Binary search over trapezoids locates a point.

Advanced Competitive Programmingsvg rendererTime O(n log n)Space O(n)

Vertical Decomposition

Available

Slices the plane at segment endpoints.

Advanced Competitive Programmingsvg rendererTime O(n^2)Space O(n)

Newton Root Finding

Available

Tangent iteration converges to a function root.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(1)

Simpson Integration

Available

Approximates integrals with parabolic arcs.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)

Simulated Annealing

Available

Temperature-controlled random hill descent.

Advanced Competitive Programmingsvg rendererTime O(k·n)Space O(n)

Fast Fourier Transform

Available

Butterfly stages transform coefficients to values.

Advanced Competitive Programmingsvg rendererTime O(n log n)Space O(n)

Discrete Logarithm

Available

Baby-step giant-step solves g^x = a mod p.

Advanced Competitive Programmingdom rendererTime O(m)Space O(m)

Discrete Root

Available

Finds x^k = a mod p by exponentiation reduction.

Advanced Competitive Programmingdom rendererTime O(p)Space O(p)

Primality Tests

Available

Deterministic Miller-Rabin witnesses.

Advanced Competitive Programmingdom rendererTime O(log^3 n)Space O(1)

Montgomery Multiplication

Available

Multiplies residues without division by modulus.

Advanced Competitive Programmingdom rendererTime O(log m)Space O(1)

Continued Fractions

Available

Iterates floor-and-invert for rationals.

Advanced Competitive Programmingdom rendererTime O(log min(p,q))Space O(log min(p,q))

Big Integer Arithmetic

Available

Base-10 digit arrays with carry arithmetic.

Advanced Competitive Programmingdom rendererTime O(n*m)Space O(n+m)

Factorial Modulo

Available

Computes n! mod p with cancellation trick.

Advanced Competitive Programmingdom rendererTime O(n)Space O(1)

Linear Diophantine Equation

Available

Extended Euclid solves ax + by = c.

Advanced Competitive Programmingdom rendererTime O(log min(|a|, |b|))Space O(n)

Linear Congruence Equation

Available

Reduces ax = b mod m with gcd checks.

Advanced Competitive Programmingdom rendererTime O(log m)Space O(log m)

Garner's Algorithm

Available

Lifts residues incrementally across moduli.

Advanced Competitive Programmingdom rendererTime O(n^2)Space O(n)

Primitive Root

Available

Finds generators of the multiplicative group.

Advanced Competitive Programmingdom rendererTime O(p log p)Space O(p)

Factorial Divisors

Available

Counts p-adic valuation of n!.

Advanced Competitive Programmingdom rendererTime O(n log n)Space O(n)

Burnside's Lemma

Available

Averages fixed points over group symmetries.

Advanced Competitive Programmingdom rendererTime O(1)Space O(1)

Bishops on a Chessboard

Available

Counts non-attacking bishop placements.

Advanced Competitive Programmingcanvas rendererTime O(n^2 + k n)Space O(n + k)

Games on Graphs

Available

Determines winning states on directed graphs.

Advanced Competitive Programmingsvg rendererTime O(V + E)Space O(V + E)

Divide and Conquer DP

Available

Splits DP rows; optimal splits are monotone.

Advanced Competitive Programmingcanvas rendererTime O(rows * cols log cols)Space O(rows * cols)

Knuth's Optimization

Available

Quadrangle inequality narrows split ranges.

Advanced Competitive Programmingcanvas rendererTime O(n^2)Space O(n^2)

Broken Profile DP

Available

Tiles boards row by row on a broken profile.

Advanced Competitive Programmingcanvas rendererTime O(rows * cols * 2^cols)Space O(2^cols)

LCA Tarjan Offline

Available

Offline DSU answers LCA queries.

Advanced Competitive Programmingsvg rendererTime O(n + q)Space O(n)

Edge Vertex Connectivity

Available

Max-flow duality for cut sizes.

Advanced Competitive Programmingcanvas rendererTime O(V^2 * E^2)Space O(V + E)

Flow with Demands

Available

Adjusts supplies so lower bounds are met.

Advanced Competitive Programmingcanvas rendererTime O(V * E^2)Space O(V + E)

Strong Orientation

Available

Orients edges so every node stays reachable.

Advanced Competitive Programmingsvg rendererTime O(n + m)Space O(n + m)

Tree Painting

Available

Colors tree edges with two-color constraints.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)

Second Best MST

Available

Replaces one edge for the next cheapest tree.

Advanced Competitive Programmingsvg rendererTime O(E log E + E V)Space O(V + E)

DEsopo-Pape

Available

Label-correcting shortest paths with deque priority.

Advanced Competitive Programmingsvg rendererTime O(E) averageSpace O(V)

Randomized Heap

Available

Mergeable heap with random priorities.

Advanced Competitive Programmingsvg rendererTime O(log n) expectedSpace O(n)

Sqrt Tree

Available

Blocks and layers give O(1) range queries.

Advanced Competitive Programmingsvg rendererTime O(1) per querySpace O(n log log n)

Determinant by Gauss

Available

Row elimination computes determinant with pivots.

Advanced Competitive Programmingcanvas rendererTime O(n^3)Space O(n^2)

Linear System by Gauss

Available

Gaussian elimination solves linear systems.

Advanced Competitive Programmingcanvas rendererTime O(n^3)Space O(n^2)

Suffix Automaton

Available

Minimal DFA of all substrings.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)

Suffix Tree Ukkonen

Available

Online suffix tree with suffix links.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)

Palindrome Automaton

Available

Two-trie automaton of distinct palindromes.

Advanced Competitive Programmingsvg rendererTime O(n)Space O(n)
© 2026 FrontendX. All rights reserved.