A -d tree of a set of points in is a binary tree with one point per node. A node at depth splits on coordinate : the points of its left subtree have that coordinate at most the node’s, those of its right subtree at least the node’s. Built by medians, it takes the point of median coordinate as the node, and so has depth .
figs.py from kdtree.py.