Ejemplo n.º 1
0
  // merge sort test
  public static void mergeSortTest() {
    System.out.println("Running: Merge Sort Test");
    // Merge Sort
    // sorts currently destroy given list by sorting it
    MergeSort mergeSort = new MergeSort();
    int[] numList = new int[100];
    final int MAX = 1000;
    final int MIN = 0;
    for (int i = 0; i < numList.length; i++) {
      numList[i] = (int) ((Math.random() * (MAX - MIN)) + MIN);
    }

    mergeSort.run(numList);

    for (int i : numList) {
      System.out.println(i);
    }

    System.out.println(); // linebreak
  }