Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3 . Database medians. You are working as a programmer for UMass administration, and they ask you to determine the median GPA for all

Problem 3. Database medians. You are working as a programmer for UMass administration,
and they ask you to determine the median GPA for all students. However, student GPAs are stored
in two different databases, one for in-state students and one for out-of-state students. Assume there
are n students of each type, so there are 2n students total. Youd like to determine the median of
this set of 2n values, which we will define here to be the nth smallest value.
However, security is very tight, so the only way you can access these values is through queries to
the databases. In a single query, you can specify a value k to one of the two databases, and the
chosen database will return the kth smallest value that it contains. Since queries are expensive,
you would like to compute the median using as few queries as possible.
Give an algorithm that finds the median value using at most O(log n) queries.

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

From Herds To Insights Harnessing Data Analytics For Sustainable Livestock Farming

Authors: Prof Suresh Neethirajan

1st Edition

B0CFD6K6KK, 979-8857075487

More Books

Students also viewed these Databases questions

Question

Define marketing concepts.

Answered: 1 week ago

Question

1 what does yellow colour on the map represent?

Answered: 1 week ago