- buildFromPoints
Builds the tree from a set of points by recursively partitioning them according
to a random pivot.
- distance
Compute the Euclidean distance between p1 and p2.
- listSwap
Swaps two items in the given list.
- nthElement
Ensures that the n-th element is in a correct position in the list based on the
distance from origin
- partitionItems
Partition the points based on their distance to origin around the selected
pivot.
- search
Recursively search for the k nearest neighbors to target.
- searchNearest
Equivalent to the above search method to find one nearest neighbor. It is faster
as it does not need