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

Toyland is having a sale. All items are 20% off. How much will you save on an item that usually sells for $95?
If i=Square root of -1, what is the value of i^3? A.-1 B.i C.1 D.-i
x varies inversely as v, and x = 48 when v = 8. Find x when v = 64. Question 17 options: x = 8 x = 6 x = 64 x = 48
The value of x is .
What did the United States hope to achieve with the Manhattan Project? A. A way to detect Japanese aircraft carriers B. The creation of an atomic weapon
Describe any steps you have taken or plan to take in order to establish a good credit score. (3-6 sentences. 2.0 points)
A brother and a sister are in the same math class. There are 8 boys and 10 girls in the class. One boy and one girl are randomly chosen. What is the probability
Esa camisa es _____. tuyo? Or tuya?
Pablo: Yo puse: número treinta y cinco calle Libertad. ________ en Madrid.
What two major industries support the region’s economy