Question: We need to create a data structure that supports the following two operations: - Insert ( S , x ) - inserts ( x
We need to create a data structure that supports the following two operations:
InsertS x inserts x into set S
DeleteHalfS deletes the largest fracSrounded up elements from S such that any sequence of n operations takes amortized On time when we first start with an empty data structure.
a Describe your data structure and how it performs the operations above.
b Justify why n operations take On amortized time, using any method discussed in lecture. If you can't achieve On try to get as close as you can with either an amortized or a worstcase algorithm.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
