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

hhhhhhhhhhheeeeeellllllllpppppp
What is the role of environment in organizational strategy?
Please answer this correctly
help quick Given f(x) and g(x) = k⋅f(x), use the graph to determine the value of k. 3 one third negative one third −3
Companies formed conglomerates in the Gilded Era. Describe the difference of how they developed and the difference between Vertical and Horizontal Integration.
What was Stephen A Douglass view on slavery Each state should decide whether to be a free or slave state, The federal government should abolish slavery. Slavery
Question 4Identify the missing data in the following source card for an article in a periodical.Dorathy E. Leidner and Sirkka L. Jarvenpaa. "The use of Informat
A. B. C. D. what could be the correct answer? Help me please
What is in group 6 period 2 in the periodic table
.Please Help. The formula for the perimeter of a rectangle with length l and width w = P=2L+2w. A rectangular field is 140 m long and requires 425 m of fencing