Closest pair algorithm in high dimension?

152 Views Asked by At

2D case is clear. But with dimensions higher than $2$ I should choose a special partitioning hyperplane for the divide and conquer algorithm to get $O(n \log n)$. I am confused because to choose this hyperplane I should already know a sparsity parameter that I only get after I have already partitioned the space. Could somebody explain it a little more? Pseudocode or concrete implementation would be highly appreciated.