public class MergeSort
private static final Random RNG new Random10982755L;
private static final intLENGTH524288;
public static void mainString args
int arrrandomIntArray;
long startSystem.currentTimeMillis;
concurrentMergeSortarr;
long endSystem.currentTimeMillis;
if !sorteda
System.err.printlnThe final array is not sorted;
System.exit0;
System.out.printf10d numbers: 6d msn, LENGTH, endstart;
private static int randomIntArray
int arrnew intLENGTH;
for int i0; iarr.length; i
arriRNG.nextIntLENGTH10;
return arr;
public static boolean sortedint arr
return !IntStream.range1, arr.length
.mapToObjiarri1arri
.findFirst.orElsefalse;
Reviews
There are no reviews yet.