Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é k-d tree?

Definition 29.6 University Computer Science — Year 2 · Capítulo 29 — Learning from Examples: Decision Trees and Clustering

A kk-d tree of a set of points in Rk\mathbb{R}^k is a binary tree with one point per node. A node at depth ii splits on coordinate i mod ki \bmod k: the points of its left subtree have that coordinate at most the node’s, those of its right subtree at least the node’s. Built by medians, it takes the point of median coordinate as the node, and so has depth ⌊log⁡2n⌋\lfloor \log_2 n \rfloor.

A k-d tree of 15 points built by medians. The circled point is the root: its vertical line splits the square in two. Each half is split by a horizontal line through its median point, and so on, alternating. Blue: splits on x; red: splits on y. Drawn by figs.py from kdtree.py.
A kk-d tree of 15 points built by medians. The circled point is the root: its vertical line splits the square in two. Each half is split by a horizontal line through its median point, and so on, alternating. Blue: splits on xx; red: splits on yy. Drawn by figs.py from kdtree.py.
Ler no capítulo →