Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose we have an array A = [ k , d , c , i , t , e , s , n , o

Suppose we have an array A =[k, d, c, i, t, e, s, n, o, p, j, u, x, a, q, y, l, b, g, m, h, r, v, f, w] which includes 25 integers and we are trying to find the median of A. You can assume that variables that are lexicographically greater have greater values.
(a) Utilize the median of medians algorithm to find the "true" median of A. Please use subarrays of size 5. If the length of the array is not a multiple of 5, the last sub-array can be incomplete. Note that you do not have to show work when sorting sub-arrays or ordering the medians of sub-arrays.
(b) In the first iteration, what values are guaranteed to be less than the median of medians? What values are guaranteed to be greater than the median of medians?
(c) What would be the time complexity of this algorithm if our sub-arrays were of size 10?

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 And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

5. Discuss the role of the Web in career management.

Answered: 1 week ago

Question

4. Design a career management system.

Answered: 1 week ago

Question

4. Evaluation is ongoing and used to improve the system.

Answered: 1 week ago