56.3k views
1 vote
consider the following method that processes an array to find the smallest value in the array. the array has a nonzero length and is initialized with int values. // arr is the array to be processed public static int findmin (int[] arr) { int min

User Ragerory
by
7.5k points

1 Answer

3 votes

You can use a sorting algorithm (like bubble sort) to sort the array in ascending order and the smallest integer will be `arr[0]`.

User Alex  Malkov
by
8.0k points