crvs/KDTree

will nth_element make some bug?

Opened this issue · 1 comments

when build the tree, if the nth number(middle nuumber) have other same member, the seperation of the left/right sub tree will have some error, right?
because this will not fit the condition, which in one dim, left subtree is <= father node, and right subtree is > father node, when the condition occur, i think it will effect query operation.
thank you

crvs commented

off the top of my head, I can't be sure, I'll think about this and try to come up with a test-case to make sure everything works as expected.