How many baby medians are less than or equal to chosen pivot

Assignment Help Computer Engineering
Reference no: EM131841600

Problem

This problem deals with modification of the quick-select algorithm to make it deterministic yet still run in O(n) time on an n-element sequence. The idea is to modify the way we choose the pivot so that it is chosen deterministically, not randomly, as follows:

Partition the set S into ...n/5... groups of size 5 each (except possibly for one group). Sort each little set and identify the median element in this set. From this set of ...n/5... "baby" medians, apply the selection algorithm recursively to find the

median of the baby medians. Use this element as the pivot and proceed as in the quick-select algorithm. Show that this deterministic method runs in O(n) time by answering the following questions (please ignore floor and ceiling functions if that simplifies the mathematics, for the asymptotics are the same either way):

a. How many baby medians are less than or equal to the chosen pivot? How many are greater than or equal to the pivot?

b. For each baby median less than or equal to the pivot, how many other elements are less than or equal to the pivot? Is the same true for those greater than or equal to the pivot?

c. Argue why the method for finding the deterministic pivot and using it to partition S takes O(n) time.

d. Based on these estimates, write a recurrence equation to bound the worst-case running time t(n) for this selection algorithm (note that in the worst case there are two recursive calls-one to find the median of the baby medians and one to recur on the larger of L and G). e. Using this recurrence equation, show by induction that t(n) is O(n).

Reference no: EM131841600

Questions Cloud

Design a stable version of the bucket-sort algorithm : Design and implement a stable version of bucket-sort algorithm for sorting a sequence of n elements with integer keys taken from the range [0,N - 1], for N = 2.
What are the key teaching points for pseudoephedrine : Kenneth is seen in the clinic with symptoms of a cold. The health care provider recommends that he take pseudoephedrine.
Name at least three mistakes that holmes made : What were some of the threats and claims made that Holmes could not prove? Is it ever acceptable to make a threat that involves physical violence?
Brief description of the public administrator : Post a brief description of the public administrator's ethical issue in the case you selected. Explain the ethical breaches within the organization.
How many baby medians are less than or equal to chosen pivot : How many baby medians are less than or equal to the chosen pivot? How many are greater than or equal to the pivot?
Ethics of dissent : As a public administrator, do you believe that it is better to go along with a policy or practice that you know is wrong or to work against your supervisors
Describe the ways in which social movements such as civil : Describe the ways in which social movements such as civil rights, women's rights, and consumerism have affected the development of public relations.
Give the major benefits that companies experience : Review expatriate key success factors, i.e., professional/technical skills, relational abilities, international motivation, family situation, and language skill
Explain the determinants of health care : The U.S. health care system evolved between the times of preindustrial to postindustrial America. How have the determinants of health care and associated.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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