Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

Discuss how S. Truett Cathys values shaped Chick-fil-As operation.

Answered: 1 week ago