An Improved Method to Build the KD Tree Based on Presorted Results
Yu Jun Cao, Xiaojiang Zhang, Boheng Duan, Wenjing Zhao, Huizan Wang · 2020
KD (K-dimension) tree is widely used in solving multi-dimensional space search problems, such as the nearest neighbor search, ray tracing, etc. During the process of KD tree construction, the median point in a specified dimension is generally chosen as the split point so as to build a balanced tree. As the performance of building a KD tree is strongly influenced by the efficiency of the selection of the median point, a variety of methods have been developed to select the median point quickly and accurately. However, the performance of methods introduced in most previous literature is either uncertain or time consuming. This paper proposes an improved method to build the KD tree based on presorted results. Compared with previous similar work, the new algorithm not only reduces unnecessary comparisons during presorting and construction, but also could handle problems with duplicate data, which expands the application of such methods.