Design an algorithm that finds the median salary

Assignment Help Computer Engineering
Reference no: EM133217992

Question: You are interested in finding the median salary in Syracuse City. The city has two towns, Happyville and Sadtown. Each town maintains a database of all of the salaries for that particular town, but there is no central database. Each town has given you the ability to access their particular data by executing queries. For each query, you provide a particular database with a value k such that 1 ≤ k ≤ n, and the database returns to you the kth smallest salary in that town. You may assume the following:

• Each town has exactly n residents (so 2 × n total residents across both towns)

• Every salary is unique (i.e., no two residents, regardless of town, have the same salary)

• We define the median as the nth highest salary across both towns. (a) Design an algorithm that finds the median salary across both towns in θ(log(n)) total queries. (b) Prove that the algorithm finds the correct answer.

Reference no: EM133217992

Questions Cloud

Write a report on smart home automation system : Write a report on smart home automation system project with the capability of Internet of Things (IoT) applications incorporating different sensors
In what ways can each party leverage power to force : In what ways can each party leverage power to force a deal on favorable terms? Provide examples of power-based moves that each party could employ
Identify two to three features of pycharm : Identify two to three features of PyCharm that could make coding easier for programmers, and briefly explain why.
How do you think technology helps solve crimes : Coincidentally this revolution has led to a direct increase in solved crimes. How do you think technology helps solve crimes? Think about how technology
Design an algorithm that finds the median salary : Design an algorithm that finds the median salary across both towns in ?(log(n)) total queries. (b) Prove that the algorithm finds the correct answer.
Explain some advantages a business : Explain some advantages a business would get from utilizing cloud computing of the chosen model.
Write the command to display the contents : Write the command to display the contents of a file in your current directory called 'notes' so that you have forward and backward page control and the display
Creating a miniature established models : Embracing reasonable assumptions and zeroing in on creating miniature established models that are resistant to the Lucas investigate.
Explain the pros of LTD using external finance vs cash : Explain the pros of LTD using external finance vs. cash on hand in this venture. Provide four supporting examples

Reviews

Write a Review

Computer Engineering Questions & Answers

  Protecting the operating systems

Explain the relative benefit and de-merits of at least three different measures that are used in order to protect the operating systems.

  Regarding the national defence authorization act

Cyber security Act of 2012, National Defence Authorization Act (NDAA), and Library Services and Technology Act are the three recent laws dealing with computer crimes.

  Define the terms procedural abstraction and data abstraction

Discuss the differences between the waterfall model and Unified Model of the software life cycle. Define the terms procedural abstraction and data abstraction.

  Write an algorithm to determine the two closest cities

Suppose you are given a set of cities (p number of cities) and there longitude and latitude coordinates. You need to determine the two closest cities.

  Review problem on software development

Software development is a complex task, especially as technology changes at the speed of light, environments evolve, and more expectations are placed.

  Descibe the isp tiers and classification and purposes

What is the subnet mask of a prefix of 26? How you obtain that subnet mask? Describe a prefix length and its used to identify networks.

  List and describe the methods for installing software

List and explain the methods for installing software. Conclude with a recommendation for your preferred software installation approach; explain why you believe this is the best approach to install software.

  Find an alternative assignment that improves the performance

The assignment of processes to slots in is arbitrary. Find an alternative assignment that improves the performance of the second example.

  How would you respond to that statement

Suppose that someone tells you that an attribute that is part of a composite primary key is also a candidate key.

  Computer platformscomputer systems may be classified into

computer platformscomputer systems may be classified into two categories classical and quantum. this assignment will

  Display a one pixel black border to the left of figures

Set the padding for figures to the equivalent of one capital M on all sides. Display a one pixel black border to the left of figures.

  Create application for an "automotive repair shop"

Create Visual Basic.NET application for an "Automotive Repair Shop". Below are the needed.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd