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

Martin Luther and Johann Gutenberg were two men who broke with the Catholic Church true false
You're conducting a physics experiment on another planet. You drop a rock from a height of 1 m and it hits the ground 0.4 seconds later. What is the acceleratio
Woodrow Wilson’s campaign slogan in 1916 was “He kept us out of __________.”
Q1. In a 100m track event, the time taken by four runners is 10 sec., 10.2 sec., 10.4 sec and 10.6 sec. Find the ratio of their speed.
what do you call a baby zebra?
Austria, Hungary, Yugoslavia, Czechoslovakia, and _________________  became independent nations after World War I.
what are the main voice types in singing?
What is the most current NASA mission on Mars?
A soccer player kicks a ball with a speed of 30 m/s at an angle of 10. How long does the ball stay in the air?
what is sugar art? could you help me?