MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

data_structures/kd_tree/kd_node.py:22–38  ·  view source on GitHub ↗

Initializes a KDNode with the given point and child nodes. Args: point (list[float]): The point stored in this node. left (Optional[KDNode]): The left child node. right (Optional[KDNode]): The right child node.

(
        self,
        point: list[float],
        left: KDNode | None = None,
        right: KDNode | None = None,
    )

Source from the content-addressed store, hash-verified

20 """
21
22 def __init__(
23 self,
24 point: list[float],
25 left: KDNode | None = None,
26 right: KDNode | None = None,
27 ) -> None:
28 """
29 Initializes a KDNode with the given point and child nodes.
30
31 Args:
32 point (list[float]): The point stored in this node.
33 left (Optional[KDNode]): The left child node.
34 right (Optional[KDNode]): The right child node.
35 """
36 self.point = point
37 self.left = left
38 self.right = right

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected