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

All women were given equal treatment on the plantation. Group of answer choices True False
what are facts about the grand canyon layers?
Why do Miriam and the other women dance and play instruments? O The Israelites have escaped the pharaoh The Israelites have fought against the pharaoh. O The wo
Pleaseee help this is standard form Y-3=2/3(x-2)
The triangle shown below has an area of 20 units. Find the missing side. 8. 2 2 units
(4 x 10") + (2 x 10) =
Which of the following statements is correct regarding the factors of production? Land includes all the "gifts of nature". This category includes the land, air,
8. By 1877, how did the condition of former slaves in the U.S. compare with that of freedpeople around the globe?
Prove or disprove the identity. If you find the identity is true, state the first line of the proof. If you find the identity is false,write the correct equatio
India has embraced theeconomy​