Module 4: Index Structures
  Lecture 14: Quadtrees and k-d-trees
 

                                           

 

Analysis of search time for k-d trees
  • Range can be thought of as two vertical lines and two horizontal lines
  • Consider one vertical line
 
  • At root (assuming there is a vertical split), either the left subtree or the right subtree is traversed
 
  • The next level children have splits on y-dimension
 
  • Hence, both subtrees may be traversed
 
  • This yields the recurrence
                       
 
  • Solving the above recurrence (with ),
                       
  • Same time for horizontal lines
  • Time for T points in the answer set is linear
  • Worst-case searching time in 2 dimensions is