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

The sides of a triangle are in the ratio 3:4:5. What is the length of each side if the perimeter of the triangle is 30 cm
Alaska has land area about 1,700,000 Florida has 1/10 of the size what is the land area of Florida
Why did the Homestead Act prompt a lot of people to head westward? A. Settlers were provided with a house and a horse. B. They heard there were many minerals
Who won the November 1964 U.S. presidential elections in a landslide victory? a. Barry Goldwater b. Robert McNamara c. Lyndon B. Johnson d. Richard Nixon
About how many people died in the civil war?
About how many people died in the civil war?
Effective teamwork and high productivity are good indications of positive A. productivity goals. B. horizontal relationships. C. reinforcement. D. socializ
What kinds of scientific investigations involve making observations?
A math problem that equals 8?
The Office of the Director of National Intelligence was created in 2005 as a result of the September 11, 2001 attacks. What does this office do? a. creates defe