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

What is a B cell? Apex
Brainliest if correct! Study the image. CHECK ALL THAT APPLY!!!! With the moon at position 3, which positions experience low tide? 3 5 6 9 12
The period between 499 and 1066 in England was a time of A. increased literacy, peace, and prosperity. B. frequent warfare, early mortality, and significan
What are the basic types of resources used by producers? Check all that apply.
11x - 4 = 5x + 20 How do I do this question/what is the answer?
A scientist is studying a form of marine bacteria growing in culture dishes. He noticed that a clear area formed around the mold where the bacteria that had gro
Can someone help me with this
Pleaseeee help me! :)
What are the possible lengths and widths of a rectangle if its length is 8 centimeters longer than the width, and the area is less than or equal to 33 square ce
11x - 4 = 5x + 20 How do I do this question/what is the answer?