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

You recently saw plastic bottles lying in the park near your house. You felt concerned that despite so much he Harmful Effects of Plastics in about 100-120 word
What are the three most common themes in Byrd's political motets?
What is the distance necessary in order to charge someone with DWI or Refusal in a school zone?
What are the four common types of biological agents?(HAZMAT)
Sarin is an odorless gas that inhibits acetylcholinesterase and causes death within minutes of exposure. On March 20, 1995, Japanese terrorists released Sarin i
what are the main actions of the tensor fascia lata?
A swimming pool is being drained. The number of gallons of water in the pool changes with time t according to the equation g = -4t + 100. Which equation correct
____ by nature, Jones spoke very little even to his own family members. a) garrulous b) equivocal c) taciturn d) arrogant
What is the format for searching plates in Sasebo
When viewing the audio portion of a clip, what do you see instead of a video image?