Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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).

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92669959

Have any Question?


Related Questions in Computer Engineering

1 the economy is in a recession with high unemployment and

1) The economy is in a recession with high unemployment and low output (i.e. the output currently is lower than the natural level of output) a) Draw a graph of aggregate demand and aggregate supply to illustrate the curr ...

The demand for salt is relatively price inelastic while the

The demand for salt is relatively price inelastic, while the demand for pretzels is relatively price elastic. How can you best explain why and elaborate your answer.

Question squareroot write a function to determine the

Question : squareroot Write a function to determine the squareroot of a number. The squareroot of a number can be approximated by repeated calculation using the formula NG = 0.5(LG + N/LG) where NG stands for the next gu ...

Under what circumstances is it ethical if ever to use

Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

Up and down a stringcreate a program called

Up and Down a string Create a program called lastnomeupAndDown take a string input from the user and print out that will substrings of increasing length next to each other until the word is fully printed, then repeat the ...

Segmentationassume virtual memory hardware that uses

SEGMENTATION Assume virtual memory hardware that uses segmentation, and divides the address space in two by using the top bit of the virtual address. Each segment is thus relocated independently. What we'll be drawing in ...

Systems analysis projectpersonal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

Research the followingmy company is alibabadetermine its

Research the following my company is Alibaba Determine its mission, vision, and goals. Discuss its IT architecture. Describe its databases, data warehouse, and data mining. Discuss it network system. Discuss its security ...

Questionimplement a calculator for a client-server

Question Implement a calculator for a client-server architecture using socket communication between the client and the server. The client should provide the graphical user interface for the user, and the server should pe ...

Assume that the pizza market consists of two firms conans

Assume that the pizza market consists of two firms, Conan's and Pizza Hut. The price of a Conan pizza is denoted by Pc and the price of a Pizza Hut Pizza is P h.  Both sellers have a marginal cost of $5 for another pizza ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As