Adaptive k-d tree