"To this program we will add the quick sort and the merge sort (non recursive)". I'm not sure how to do this with a random array. I formed this code so far, can anyone help?
import java.util.Random; public class Algo {
public static void main(String[] args) {
Random gen = new Random();
int[] a = new int[20];
for (int i = 0; i < a.length; i++)
a[i] = gen.nextInt(100);
printArray(a);
}
private static void printArray(int[] a){
for (int i : a)
System.out.print(i + " ");
System.out.println("");
}
}
}