public static void getMax(int[] arr){
int y =0;
int index =arr[0];
for (int i =0;i <arr.length ;i++ )
{
if (index < arr[i])
{
index = arr[i];
y=i;
}
}
int temp = arr[y];
arr[y]=arr[arr.length-1];
arr[arr.length-1]=temp;
}
public static void getMin(int[] arr){
int y =0;
int index =arr[0];
for (int i =0;i <arr.length ;i++ )
{
if (index > arr[i])
{
index = arr[i];
y=i;
}
}
int temp = arr[y];
arr[y]=arr[0];
arr[0]=temp;
}
public static void print(int[] arr){
for (int i = 0;i < arr.length ;i++ )
{
System.out.print(arr[i]+" ");
}