ultrametric balls · binary tree

drag · scroll to zoom
d(Lᵢ, Lⱼ) = 2^h where h = height of LCA(Lᵢ, Lⱼ) in the tree
B(x, r) = { y : d(x, y) ≤ r } — a ball is the set of all points within distance r of x. In an ultrametric tree this is always a subtree: all leaves below the LCA whose height ≤ log₂(r). Select a demo.