A Dynamic, Self-balancing k-d Tree

Russell A. Brown

公開日: 2025/9/9

Abstract

The original description of the k-d tree recognized that rebalancing techniques, such as used to build an AVL tree or a red-black tree, are not applicable to a k-d tree, because these techniques involve cyclic exchange (aka rotation) of tree nodes, which destroys the sorted order of the k-d tree. For this reason, a static k-d tree is often built from all of the k-dimensional data en masse. However, it is possible to build a dynamic k-d tree that self-balances when necessary after insertion or deletion of each individual k-dimensional datum. This article describes insertion and deletion algorithms for a dynamic k-d tree, and measures their performance.