Fix inserted point not being removed from list

This commit is contained in:
karl 2020-12-28 13:51:14 +01:00
parent 80d6a27eef
commit 2ce6b06e54

View File

@ -98,7 +98,7 @@ class KDTree {
// TODO: This copies. Can we split the vector into two without copying? // TODO: This copies. Can we split the vector into two without copying?
std::vector<Point *> left_of_median(points.begin(), points.begin() + middle); std::vector<Point *> left_of_median(points.begin(), points.begin() + middle);
std::vector<Point *> right_of_median(points.begin() + middle, points.end()); std::vector<Point *> right_of_median(points.begin() + middle + 1, points.end());
// Create node, recursively call to construct subtree // Create node, recursively call to construct subtree
return new Node(axis, median, build(left_of_median, depth + 1), return new Node(axis, median, build(left_of_median, depth + 1),