KDTree is a class supporting KD-tree insertion, deletion, equality search, range search, and nearest neighbor(s) using double-precision floating-point keys. Splitting dimension is chosen naively, by depth modulo K. Semantics are as follows:

  • Two different keys containing identical numbers should retrieve the same

value from a given KD-tree. Therefore keys are cloned when a node is inserted.

  • As with Hashtables, values inserted into a KD-tree are not cloned.

Modifying a value between insertion and retrieval will therefore modify the value stored in the tree.

@author Simon Levy, Bjoern Heckel @version %I%, %G% @since JDK1.2