The original description of the k-d tree recognized that rebalancing techniques, such as are used to build an AVL tree or a red-black tree, are not applicable to a k-d tree. Hence, in order to build a balanced k-d tree, it is necessary to find the median of the data for each recursive subdivision of those data. The sort or selection that is used to find the median for each subdivision strongly influences the computational complexity of building a k-d tree. This paper discusses an alternative algorithm that builds a balanced k-d tree by presorting the data in each of k dimensions prior to building the tree. It then preserves the order of these k sorts during tree construction and thereby avoids the requirement for any further sorting. Moreover, this algorithm is amenable to parallel execution via multiple threads. Compared to an algorithm that finds the median for each recursive subdivision, this presorting algorithm has equivalent performance for four dimensions and better performance for three or fewer dimensions.
k-d 트리의 원래 설명은 AVL 트리 또는 레드-블랙 트리를 구축하는 데 사용되는 재균형 기법이 k-d 트리에 적용되지 않음을 인식했다. 따라서 균형잡힌 k-d 트리를 구축하려면 데이터의 각 재귀적 세분화에 대해 중앙값을 찾아야 한다. 각 세분화에 대해 중앙값을 찾는 데 사용되는 정렬 또는 선택 알고리즘은 k-d 트리 구축의 계산 복잡도에 큰 영향을 미친다. 본 논문은 트리 구축 전에 k개 차원 각각에서 데이터를 사전 정렬하여 균형잡힌 k-d 트리를 구축하는 대체 알고리즘을 제시한다. 그 후 트리 구축 과정에서 이 k개의 정렬된 순서를 유지하여 추가 정렬의 필요성을 피한다. 또한 이 알고리즘은 다중 스레드 병렬 실행에 적합하다. 각 재귀적 세분화에 대해 중앙값을 찾는 알고리즘과 비교할 때, 이 사전 정렬 알고리즘은 4차원에서 동등한 성능을 보이며, 3차원 이하에서는 더 나은 성능을 보인다.
전체 평가: 이는 k-d 트리 구축 분야에서 혁신적인 사전 정렬 방법을 제시한 고품질의 알고리즘 논문이다. 논문의 이론 분석은 엄밀하고, 실험 설계는 완전하며, 실용적 가치가 높다. 고차원 경우에 한계가 있지만, 저차원 공간 데이터 처리에 효과적인 해결책을 제공하며 관련 분야에 중요한 참고 가치를 지닌다.