Watch a Quadtree in action

Below you'll see a square filled with data points, cut into boxes. Each box is a node in the quadtree.

Click anywhere in the square to begin an algorithmic search for the closest data point in the set to where you clicked. The pink border tells you the current node being searched in the tree.

Use the step over button to see each separate action of the algorithm, or hit play to let it run itself.


Current node being tested
Ignored node
Red dot: click location. Green dot: closest point. Orange dot: scanned point.