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
The running time needed to answer findAllContainingxy is Olog2 n k where k is the number of answers ... View full answer
Get step-by-step solutions from verified subject matter experts
