Find both the minimum and the maximum in an array

Assignment Help Other Subject
Reference no: EM13539126

Min and Max

Suppose we wish to find both the minimum and maximum values in an array of n distinct elements.

To individually find either the minimum or maximum, there is clearly a n-1 lower bound on comparisons, since we must compare every element at least once. We can save a comparison by first scanning for the minimum, removing it, then scanning for the maximum. This takes a total of 2n-3 comparisons.

Based on this observation, prove the following statement true or false:

“It takes at least  2n-c comparisons, for some constant c , to find both the minimum and the maximum in an array of n distinct elements.”

Reference no: EM13539126

Questions Cloud

Calculate the overall efficiency of the system : A gas stream with a particulate loading of 20.0g/m^3 is passed through a 70%-efficient cyclone followed by a 95%-efficient ESP. Calculate the overall efficiency of the system.
The effect violent video games has on kids : The effect violent video games has on kids
Get the information from a community health survey : Get the information from a community health survey
The decryption algorithm : Using RSA, encode the word "cat" by encrypting each letter separately. Choose p=3, q=11 and e=9. Apply then the decryption algorithm. Show all the calculation steps.
Find both the minimum and the maximum in an array : To individually find either the minimum or maximum, there is clearly a n-1 lower bound on comparisons, since we must compare every element at least once.
Write a paper on the relative merits of .net and j2ee : Write a paper on the relative merits of .NET and J2EE as a platform for business systems integration.
Research a specific brand name secure usb thumb drive : Research a specific brand name secure USB Thumb drive and list the security advantages. Discuss its specifications. How does it compare with a cloud application of similar functionality? Name two of these services.
What would the value of the field containing the parity bit : What would the value of the field containing the parity bits be for the case of a two-dimensional parity scheme, if an even parity scheme is used? Your answer should use a minimum-length checksum field.
Why linux is installed on only a very small fraction of desk : 1) Describe some reasons why Linux is installed on only a very small fraction of desktop computers. Are there particular categories of products or users who might see Linux as more appealing than conventional operating systems? Do you think Li..

Reviews

Write a Review

Other Subject Questions & Answers

  Describe how the global integration of cultures

Describe how the global integration of cultures, including Eastern metaphysical influences, has affected contemporary philosophical thinking.

  Explain diplomatic breakthroughs with china and russia

How did Nixon handle to achieve diplomatic breakthroughs with China and Russia where other presidents had failed? What situations made success likely?

  Illustrate what next should be focus of fsiec over years

Patt ONeill introduced main item on day's agenda: discussion of illustrate what next should be focus of FSIEC over coming year.

  Health care system of evolution

discussing how the evolution of health care delivery systems has influenced current health care systems.

  Pathophysiologic progression of the infection

Describe the pathophysiologic progression of the infection into pneumonia and at least two medical or nursing interventions that would be helpful in treating the patient.

  Understanding of persoanlity and self-concept

How can the study of knowledeg stucture, or "schemas" inform the understanding of persoanlity and self-concept?

  Industrial-organization psychologist

If you work as an Industrial-Organization psychologist to give advice to electronic industries, what suggestions would you make?

  Ernst cassirer may be remembered as

Ernst Cassirer may be remembered as

  We know of has lived without some form of art

No society that we know of has lived without some form of art. The impulse to make and respond to art appears to be as deeply ingrained as the ability to

  Visit a cultural center-interfaith dialogue

"Visit a cultural center, interfaith dialogue or spend an afternoon with someone of another culture/religion/ethnicity to learn more about that world view."

  Why does socrates dialectical method preven

Why does Socrates' dialectical method prevent him from being a Sophist? Sophists, unlike Socrates, specialized in using rhetoric to impress or persuade an audience.

  Most important contribution from the italian renaissance

Who would lead it? What do you think is the most important contribution from the Italian Renaissance that still affects the world today? Please explain why you think it is the most important and use specifics.

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