Please help with Java program.
Develop a method
void maxSort(int[] x, int size) // size <= x.length
that sorts the partially filled array x. the method maxSort(...) first determines the largest value in x and swaps that value with x[size - 1]; then maxSort(...) finds the next largest value and swaps that value with x[size - 2], and so on.
Write a main method to test your method.
THEN:
Extract the inner loop as an auxiliary method int max(int[] x, int)
that returns the index of the largest element between x[0] and x[i], inclusive.