HomeAlgorithms & AISplay Trees: The Self-Adjusting Binary Search Tree

🌳 Splay Trees: The Self-Adjusting Binary Search Tree

Explore how a splay tree reshapes itself with every access, using zig, zig-zig, and zig-zag rotations to move nodes to the root and keep frequently used data cheap to reach.

Algorithms & AI3DModerate60 FPS
splay-tree-lab ↗ Open standalone

This simulator visualizes a splay tree responding to node accesses, showing the zig, zig-zig, and zig-zag rotations that carry the selected node up to the root step by step.

🔬 What It Demonstrates

This simulator visualizes a splay tree responding to node accesses, showing the zig, zig-zig, and zig-zag rotations that carry the selected node up to the root step by step.

🎮 How to Use

Click any node in the tree to splay it, and watch the highlighted rotation sequence unfold one step at a time as the tree reshapes itself around your selection.

💡 Did You Know?

Splay trees were invented in 1985 by Daniel Sleator and Robert Tarjan, and their surprising trick is that they need no stored balance information at all, unlike AVL or red-black trees.

⚙ Under the hood

Explore how a splay tree reshapes itself with every access, using zig, zig-zig, and zig-zag rotations to move nodes to the root and keep frequently used data cheap to reach.

splay treebinary search treedata structurestree rotationsamortized analysisalgorithmsself-balancing treescomputer science

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)