For a sample of points drawn uniformly from either the d-dimensional torus or the d-cube, d ≧ 2, we give limiting distributions for the largest of the nearest-neighbor links. For d ≧ 3 the behavior in the torus is proved to be different from the behavior in the cube. The results given also settle a conjecture of Henze (1982) and throw light on the choice of the cube or torus in some probabilistic models of computational complexity of geometrical algorithms.