BSTs, AVL rotations, red-black recoloring, heaps, tries, and segment trees — live.
47 visualizations
Visits every node in in-order, pre-order, post-order, or level-order — the four canonical traversals.
An ordered tree where left < node < right, giving O(h) search, insertion, and deletion.
Visits a binary tree breadth-first, level by level, using a FIFO queue to process nodes in order.
Builds a binary min-heap via sift-up insertions and removes the minimum with sift-down, all in an array.
Stores a set of strings in a prefix tree, sharing common prefixes; supports fast insert and lookup by walking edges.
A height-balanced binary search tree that rotates after inserts to keep every balance factor in {−1, 0, +1}.
Answers range-sum queries and point updates in O(log n) by storing partial sums over a binary tree of index ranges.
A compact array that answers prefix-sum queries and point updates in O(log n) using the low-bit trick i & −i.
A self-balancing BST that uses node colors and 5 invariants to guarantee O(log n) operations with few rotations.
A balanced multiway search tree where nodes hold many keys and split when full, keeping all leaves at the same depth.
Moves every inserted or accessed node to the root through explicit zig and double rotations.
Preserves BST order by key and min-heap order by priority using rotations.
Builds a complete max-heap with visible swaps and extracts requested maxima one at a time.
Inserts into one/two-key nodes and exposes every temporary three-key overflow, split, and promotion.
Alternates x/y splits during insertion and performs nearest-neighbor search with legal branch pruning.
Stores subtree maximum endpoints and uses them to prune overlap searches safely.
Converts infix to postfix, builds the exact operator tree, and evaluates it bottom-up.
Reuses null links as predecessor/successor threads and traverses in-order without recursion or a stack.
Maintain a level-based balanced search tree using only right and left rotations.
Build a min-Cartesian tree whose inorder traversal is the original sequence.
Augment a search tree with subtree sizes to answer rank and selection queries.
Compress unary trie paths into substring-labelled edges.
Insert every text suffix so substring queries become trie walks.
Hash leaves and pairwise child digests until one authenticated root remains.
Recursively divide 2D space into four quadrants and prune range searches.
Recursively divide 3D space into eight octants.
Group spatial rectangles by bounding-box enlargement and split overflowing nodes.
Recursively split a bounded integer universe to support successor queries.
Precompute power-of-two ancestors and answer LCA queries with logarithmic jumps.
Traverse a binary tree inorder using temporary predecessor threads.
Find a longest tree path using two breadth-first sweeps.
Reduce lowest-common-ancestor queries to range minima over an Euler tour.
Recursively remove a balanced centroid from each remaining component.
Split root-to-leaf paths into heavy chains so any path uses logarithmically many segments.
Maintains probabilistic express lanes over an ordered linked structure.
Path-copies updates so every historical range-query version remains accessible.
Defers range updates in lazy tags while preserving logarithmic queries.
Represents sequence positions by subtree sizes for split, merge, and reversal.
Maintains dynamic forest paths through preferred-path splay trees.
Restores weight balance by rebuilding the first excessively deep ancestor.
Recursively partitions an alphabet to answer rank, select, and range-kth queries.
Provides amortized constant-time access at both sequence ends with cached measures.
Scores split thresholds using weighted Gini impurity.
Traces zig and double rotations toward the root.
Maintains BST order and heap priorities.
Traces multiway node splits during insertion.
Defers range additions while preserving sums.