public class TestMain { public static void main(String[] args) { Integer[] a = new Integer[5000]; for (int i = 0; i < a.length; i++) { int temp = (int)(StdRandom.random()*10000); a[i] = temp; } Integer[] b = new Integer[5000]; for (int i = 0; i < b.…