Question: (10p) Consider the problem of maintaining a dynamic set, S, of real numbers that supports the following two types of operations: - Insert(S,x): Inserts number

(10p) Consider the problem of maintaining a dynamic set, S, of real numbers that supports the following two types of operations: - Insert(S,x): Inserts number into S. - Delete(S): Deletes the largest [numbers from S. Show how to implement this set with O(1) amortized cost per operation. Present your solution as follows. The data structure. The implementation of the operations Insert(9x) and Delete(s). Prove using the potential function method that the amortized cost of each Insert or Delete operation is 0(1), assuming that we are start with an empty set
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
