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

Explain how did Roosevelt’s New Deal fundamentally changed the way that Americans conceptualized the role of the federal government.
Which formula/name pair is incorrect? A) FeSO4 iron(II) sulfate B) Fe2 (SO3)3 iron(III) sulfite C) FeS iron(II) sulfide D) FeSO3 iron(II) sulfite E) Fe2 (S
For good service, a garbage collector regularly receives PHP80.00 each from 9 households in our neighborhood once a week. How much does the garbage collector ea
4) rotation 90° counterclockwise about the origin I j k l​
Craig and Sophie are recording their classmates' hair colors for a genetics assignment. In Craig's class, 4 out of the 20 students have blond hair. In Sophie's
electronic configuration of 14S​
Which statement best expresses a theme of "Gumption"?
Which statement BEST explains why Robert Fenton took pictures of the battle field after battle? A. Robert Fenton was inspired by the Civil war photographer Matt
Gravity is a successful and popular ice cream parlor in the community. It sells a variety of soft-serve and hard ice cream flavors. Its main competitor, dairy t
Whoever answers this get brainliest What is 848,395 x 928