public class KdTree extends Object
K-D Tree is short for k-dimensional tree and is a binary tree data structure used for quickly finding the
nearest-neighbor of a k-dimensional point in a set. Each point can optionally have data associated with it.
The tree is structured such that at each node has a point and two children. All points in the set with
<= to the node's point in the specified dimension/axis are on the the left and
>= to the right. A leaf
will have no children.
NOTE: If multiple points have identical values then there will be a node for each point.
NOTE: If there is more than one point with an identical value to the node's point, then the identical points can go in either the left or right branches.
Nested Class Summary
Nested Classes Modifier and Type Class Description
static classData type for each node in the binary tree.
Fields Modifier and Type Field Description
Constructors Constructor Description
(int N)Specifies the type of points it can process.
Npublic int N
root@Nullable public @Nullable KdTree.Node root
KdTreepublic KdTree(int N)Specifies the type of points it can process.
N- Number of elements in a point