How to sort a multidimentional array to search for the nearest neighbor in $O(\log(N))$?

46 Views Asked by At

There is a set of points in 10 dimentional space like $(x_0,x_1,x_2,\ldots x_9) \rightarrow $ value. I need to store them in a sorted manner so that whenever a new point $(x_0,x_1,x_2, \ldots ,x_9)$ appears I can quickly $~O(\log(N))$ find the nearest neighbor of the new point.

This is trivial in one dimentional case: use a sorted array. Binary search it's neighbors $O(\log(N))$. Add this new point to a sorted array $O(\log(N))$. But what about the multidimensional case?