Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 complexityStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started