Mars123
Mars123 Mars123
  • 20-03-2017
  • Computers and Technology
contestada

Write an algorithm to find the maximum and minimum number from a given list of N numbers .Assume the list is not sorted

Respuesta :

rsmith6559
rsmith6559 rsmith6559
  • 23-03-2017
maxNumber = 0
minNumber = INT_MAX

for n in list:
  if( n > maxNumber):
   maxNumber = n
  elif( n < minNumber ):
   minNumber = n
Answer Link

Otras preguntas

I need help please. (1) Why does lightning make such a loud sound? (2) The answer has to do with the electrical energy it gives off. (3) A single bolt may produ
Factor: x2 - 11x + 30
sea grass grow on the ocean floor in shallow areas runoff from the land into the ocean can cause the waters to become cloudy. cloudy water affects the sea grass
∆ABC ~ ∆DEF. If ∠A=75° and ∠E=15°, what is the measure of ∠C?
Which of these lines from Shakespeare’s Twelfth Night reveals that Viola would use a different method to woo the person she loved than that used by Orsino? VIOL
Prime factorization tree of 30
two companies rent moving trucks. pack and go charges $39.95 flat fee and $0.45 for every mile driven. U-drive charges $59.95 flat fee and $0.35 for every mile
PLEASE HELP IT'S URGENT!!! ONLY ANSWER IF YOU KNOW THE CORRECT ANSWER Which word in the sentence is a participle? Do not lean on the painted walls. A. Do
find the radius of a circle with an area of pie (16x^2+40x+25)
The amount of freedom a woman in ancient Rome enjoyed depended on what?