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

Select the correct answer. In the following lines from Henry Wadsworth Longfellow’s “The Arrow and the Song,” what does the image of the unbroke arrow symbolize
HELP!!!! A quarter circle is attached to the side of a square as shown. What is the best approximation for the area of this figure? Use 3.14 to approximate pi.
What is the lateral area of the square pyramid, to the nearest whole number? A. 165 m2 B. 176 m2 C. 330 m2 D. 351 m2
Help Me! Pick An Scenario! Thank you!
The diagram shows a fossil of an ancient whale skull and a skull of a present-day whale. The ancient whale is extinct and is believed to be an ancestor of the p
What is 77÷11(points giveaway)​
Can someone please help me with math.
Which of the following is a form of indirect lobbying? (3 points) • Calling government leaders to ask for support •Contacting local elected officials by email •
write about the oppression that happened to esmeralda and the other gypies
(2,3), (4,-7) midpoint