The original description of the k-d tree recognized that rebalancing techniques, used for building an AVL or red-black tree, are not applicable to a k-d tree, because these techniques involve cyclic exchange of tree nodes that violates the invariant of the k-d tree. For this reason, a static, balanced 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 k-dimensional datum. This article describes insertion, deletion, and rebalancing algorithms for a dynamic, self-balancing k-d tree, and measures their performance.
翻译:k-d树的原始描述中已指出,用于构建AVL树或红黑树的再平衡技术不适用于k-d树,因为这些技术涉及树节点的循环交换,会破坏k-d树的不变性。因此,通常通过批量处理所有k维数据来构建静态平衡的k-d树。然而,在插入或删除每个k维数据后,可以构建一种能够在必要时自平衡的动态k-d树。本文描述了动态平衡k-d树的插入、删除和再平衡算法,并对其性能进行了评估。