optimization: segment-tree like approach to build bounding box in KD-tree.