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

On August 24, in the year 79 CE, the sky in Pompeii, Italy, grew dark and ominous. An orange glow illuminated the blackened sky. When the city’s residents hear
Two promotional stands are to be placed in an ellipse-shaped room—one at each foci—and are 3 units from the center. If the room is 8 units wide, what is its len
i need help to find the rest
I need to know the answer to this
A student takes a measured volume of 3.00 M HCl to prepare a 50.0 mL sample of 1.80 M HCl. What volume of 3.00 M HCl did the student use to make the sample? Use
What was the most effective method used by the German government to get the populace to accept Nazi ideology?
Can a moderator please help me? Find the mode: 31, 1, 12, 2, 21, 22, 1, 0, 31, 13 A, 1 B, 31 C, 1 & 31 D, no mode
In the United States after World War II, which cause of anxiety was a common theme in invasion literature?
NEED ASAP!! Stanza in picture
The velocity a rocket must reach to establish an orbit around Earth is called escape velocity. Please select the best answer from the choices provided T F