data_structures.kd_tree.build_kdtree

Functions

build_kdtree(...)

Builds a KD-Tree from a list of points.

Module Contents

data_structures.kd_tree.build_kdtree.build_kdtree(points: list[list[float]], depth: int = 0) data_structures.kd_tree.kd_node.KDNode | None

Builds a KD-Tree from a list of points.

Args:

points: The list of points to build the KD-Tree from. depth: The current depth in the tree

(used to determine axis for splitting).

Returns:
The root node of the KD-Tree,

or None if no points are provided.