BallTree construction with top-down KD method

Construct a ball tree with top-down KD algorithm, using bounding spheres to define the root box and children boxes. Each bounding sphere has a center and a radius_sq, representing the center coordinates of the bounding sphere, and the square of the radius of this sphere.