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

An assistant for a football team carries a 26.0 kg cooler of water from the top row of the stadium, which is a distance h = 20.5 m above the field level, down t
Case-Based Critical Thinking QuestionKamilla is creating a pet adoption Web site, and is currently learning about her options using the position property.If Kam
What was special about the 1993 March on Washington?
Simplify the equation please.
Please need help....need to answer
The Morphology of Homo erectus:__________.This species weighted well over 100 pounds, with an average height of about 5 feet 6 inches. They had a large brain si
1. What expressed powers show that the framers wished Congress to have the power to secure the nation against foreign danger? Select all that apply. -raise armi
Endosymbiosis refers to the process in which prokaryotes live within eukaryote hosts. The endosymbiosis model of mitochondria and chloroplast evolution states t
What is the distance between points (-6, 4) and (3,-4)? Select the best answer from the choices provided.
A set of 10 coins may contain any combination of pennies, nickels, dimes, quarters, or half-dollars. In how many different ways can the set of 10 coins have a t