Question: Design a static data structure (which does not support insertions and deletions) that stores a two-dimensional set S of n points and can answer, in
Design a static data structure (which does not support insertions and deletions) that stores a two-dimensional set S of n points and can answer, in O(log2 n) time, queries of the form countAllInRange(a, b, c, d), which return the number of points in S with x-coordinates in the range [a, b] and y-coordinates in the range [c, d]. What is the space used by this structure?
Step by Step Solution
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Use a range tree where in addition to the usual inf... View full answer
Get step-by-step solutions from verified subject matter experts
