[algogeeks] design a data structure

2011-01-30 Thread snehal jain
Design a data structure that supports the following two operations on a set S of integers: a. Insert(x; S), which inserts element x into set S, and b. DeleteLargerHalf(S), which deletes the largest ceil(|S|/2) elements from S. Show how to implement this data structure so both operations take O(1) a

[algogeeks] design a data structure.

2008-06-13 Thread Raghavendra Sharma
Hi, There are n points in a plane (p1,p2 pn). Design a O(N2) data structure so as to answer the querry "How many points are there in this rectangle" in O(1) time The rectangle will be specified by the lower left point and upper right point. Thanks, Raghavendra --~--~-~--~~--