forssenkollie forssenkollie
  • 24-08-2021
  • Computers and Technology
contestada

find the maximum and minimum of an array of size ten​

Respuesta :

jaegucci
jaegucci jaegucci
  • 24-08-2021

Answer:

// Naive solution to find the minimum and maximum number in an array. public static void findMinAndMax(int[] A) ...

int max = A[0]; int min = A[0];

// do for each array element. for (int i = 1; i < A. ...

if (A[i] > max) { max = A[i]; ...

else if (A[i] < min) { ...

System. ...

{ ...

// find the minimum and maximum element, respectively.

Answer Link

Otras preguntas

Simplify (–8q3r4s2)2 = ?
Which is greater 0.097 or 97%
how to write 7.5 as a fRACTION
The rights of Catholics to freely worship in Maryland was preserved by the .
the Johnson family is painting their house. it took them 12 hours to paint 2/3 of their house. How long will it take them to paint the whole house.
The diameter of the larger circle is 10.5 cm. The diameter of the smaller circle is 4.5 cm. What is the approximate area of the shaded region?
Why does churchill believe an invasion of British soil is not likely to occur in the near future?
what is the complete cycle of ice wedging
Which of Mendel's laws can be demonstrated by a dihybrid cross? A. the law of averages B. the law of dominance C. the law of segregation D. the law of independe
Find the measures of EAF DAE and CAD