I have pure theoretical question on KD Tree hierarchy. Let's say that we have two dimensional tree with 'left rule'.
One of tree nodes has two children which should be sorted by X value. In the same time, both children have the same X value.
So, what should I do in this case?
To my opinion, there are two option, rather I am sorting them by second (Y) value and distributed according to the 'left rule' — to the left goes one with smallest Y value, and to the right with bigger.
And the second option could be finding distances between these children points and it parent and distributing it according to distance value: closest goes to the left, the other to the right.