Question: Please help me answer this question. DEF: The arithmetic mean of a collection of numbers is the sum of all values in the collection divided
Please help me answer this question.

DEF: The arithmetic mean of a collection of numbers is the sum of all values in the collection divided by the number of values. For example, the mean of collection {3,6,20,31} is 15 . Consider the following generic operations that can be performed on a collection of n elements: - INSERT(x): add element x to the collection - GET MEAN(): remove and return the median element in the collection 7.1 [6 marks] Describe a data structure that supports the two operations above in a worst-case time complexity of O(logn) where n is the number of elements in the collection. If your answer is based on a data structure that was covered in class, explain clearly the difference between what was covered in class and your own data structure, including any additional information that would be stored in the data structure (and how). 7.2 [8 marks] Give a clear description of an algorithm for performing operation GET_MEAN() on your data structure. Explain why your algorithm has the required worst-case time complexity
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
