Write algorithm to find median value using queries

Assignment Help Data Structure & Algorithms
Reference no: EM1371240

You are interested in analyzing some hard-to-obtain data from two separate databases. Each database contains n numerical values--so there are 2n values total--and you may assume that no two values are the same. You'd like to determine the median of this set of 2n values, which we will define here to be the nth smallest value. However, the only way you can access these values is through queries to the databases. Ina single query, you can specify a value k to one of the two databases, and the chosen database will return the/(m 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.

Reference no: EM1371240

Questions Cloud

Compute calvin profit-maximizing output level : Compute  Calvin's profit-maximizing output level. Compute the Calvin's economic profits at this activity level. Is this activity level sustainable in long run?
Knowledge about business management : how taking the QRB course will prepare you for future courses in economics, finance, accounting, and research.
Local public agencies were capital constrained : Suppose you are Chief Economist of the FCC. The Chairman has called you in to discuss a thorny issue. Two wireless broadcasters operate on adjacent frequencies.
Perfect competition-cost curves : When developing short-run cost curves, it is supposed that all firms in perfect competition have the same cost curves and they all make identical short-run profits or losses.
Write algorithm to find median value using queries : As queries are expensive, you would like to calculate median using as few queries as possible. Provide the algorithm which finds median value using at most O(log n) queries.
Effect of retained earnings on divisions of a company : When the company I work for earns a profit on a project by coming in under budget on expenses or by finishing before the project due date, would that be retained earnings?
Determining amount of profit and loss : Johnston production is the price taker which utilizes this cost structure in the short run:
Question related to mass customization : Question related to mass customization - What challenges would an organization face if it sought to rely on mass customization more
Model of perfect competition : Describe and discuss the model of perfect competition and adopting strategies to gain market power in the competitive industries.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Explain spacewise efficient implementation two-stack data

Structure of such two-stack data type would consist of two arrays and two top pointers. Describe why this may not be a spacewise efficient implementation.

  Algorithm to keep track of sufficient information

Your algorithm must keep track of sufficient information so that, for any computer Cb it is possible to retrieve in O(n) time a sequence of communications by which Cb could have become infected.

  Analyze algorithm to determine length of longest substring

Explain and analyze the algorithm to determine the length of longest substring that appears both forward and backward in an input string T[1 . n].

  Sketch portion of decision tree via quicksort to sort array

Suppose you are using quicksort to sort array A with 6 distinct elements a1, a2, ..., a6. Sketch portion of the decision tree which corresponds to th ordering a3

  Transmitting image using raster scan order

If we were to transmit this image using raster scan order, after 15 seconds how many rows of the image will the user have received?

  Create divide and conquer algorithm to solve problem

Create a divide and conquer algorithm to solve problem. The time complexity of your algorithm must be O(nlgn) or better.

  Determine the branching factor

Expalin the search algorithm that results from each of the following special cases. How does it relate to other algorithms we have discussed.

  Design benefits election system-service request from huffman

Individual project for this course is in form of Service Request from Huffman Trucking. It is essential for student to access Service Request: SR-ht-001. Design a Benefits Election System.

  Efficient algorithm to achieve goal using few base stations

Certain points along the road, so that every house is within four miles of one of the base stations. Give an efficient algorithm that achieves this goal using as few base stations as possible.

  Data structures and algorithm design

Data Structures and Algorithm Design

  Determining ciphertext generated by encryption

Determine ciphertext (in binary form) generated by encryption of character X?

  Sort array of elements using the quick sort algorithm

"sort an array of 10,000 elements using quick sort algorithm as follows: sort the array using pivot as middle element of the array

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