Question: Describe an efficient data structure for storing a set S of n items with ordered keys, so as to support a rankRange(a, b) method, which
Describe an efficient data structure for storing a set S of n items with ordered keys, so as to support a rankRange(a, b) method, which enumerates all the items with keys whose rank in S is in the range [a, b], where a and b are integers in the interval [0, n − 1]. Describe methods for object insertions and deletion, and characterize the running times for these and the rankRange method.
Step by Step Solution
3.46 Rating (162 Votes )
There are 3 Steps involved in it
Use a balanced binary tree T which stores the points of S in its external nodes ordered ... View full answer
Get step-by-step solutions from verified subject matter experts
