Question: Suppose we are given a range-searching data structure D that can answer rangesearching queries for a set of n points in d-dimensional space for any

Suppose we are given a range-searching data structure D that can answer rangesearching queries for a set of n points in d-dimensional space for any fixed dimension d (like 8, 10, or 20) in time that is O(logd n+k), where k is the number of answers. Show how to use D to answer the following queries for a set S of n rectangles in the plane: 

  • findAllContaining(x, y): Return an enumeration of all rectangles in S that contain the point (x, y). 
  • findAllIntersecting(a, b, c, d): Return an enumeration of all rectangles that intersect the rectangle with x-range [a, b] and y-range [c, d]. 

What is the running time needed to answer each of these queries?

Step by Step Solution

3.43 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The running time needed to answer findAllContainingxy is Olog2 n k where k is the number of answers ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Data Structures Algorithms Questions!