insert

fun insert(item: T): KDTreeNode<T>(source)

Inserts an item into the KD-Tree.

This method adds a new item to the KD-Tree, determining its appropriate position based on the structure of the tree, the number of dimensions, and the provided mapping function for extracting coordinate values.

Return

The newly created KDTreeNode containing the inserted item.

Parameters

item

The item to be inserted into the KD-Tree.