Question 16
What data structure can reduce the average-case query time for finding nearest neighbors in low-dimensional space from O(N d) to O(d log N)?
Original solution basis:
A kd-Tree partitions spatial dimensions hierarchically, enabling nearest neighbor lookups in average O(d log N) time.
Deep Dive
A kd-tree recursively partitions a low-dimensional feature space using axis-aligned splits. During a query, entire regions can often be excluded, so the search visits far fewer than N points. The often-quoted O(d log N) behaviour is an approximate average-case description under favourable low-dimensional conditions, not a worst-case guarantee. In the worst case, search can approach O(Nd).
Key Points to Remember:
• kd-trees are most useful in low-dimensional spaces.
• Average query cost can be substantially below brute force, but depends on data and dimension.
• Worst-case nearest-neighbour search can still examine nearly all points.
Exam tip:
Identify the governing definition or theorem first, write the formula, substitute the given values, and check dimensions/signs before selecting the option.