-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
35 lines (30 loc) · 1.31 KB
/
Main.java
File metadata and controls
35 lines (30 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package sort;
import utils.ArrayUtils;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
// Integer[] arr = {5, 65, 324, 634, 23423, 5, 7, 1};
// SelectionSort.sort(arr);
// ArrayUtils.printArray(arr);
// System.out.println();
//
// Student[] students = {new Student("Alice", 98),
// new Student("Bobo", 100),
// new Student("CC", 66)};
// SelectionSort.sort(students);
// ArrayUtils.printArray(students);
int[] dataSize = {10000, 100000, 1000000};
for (int n : dataSize) {
Integer[] randomArray = ArrayUtils.generateRandomArray(n, n);
//Integer[] insert = Arrays.copyOfRange(randomArray, 0, randomArray.length);
//Integer[] select = Arrays.copyOfRange(randomArray, 0, randomArray.length);
Integer[] quick = Arrays.copyOfRange(randomArray, 0, randomArray.length);
Integer[] heap = Arrays.copyOfRange(randomArray, 0, randomArray.length);
ArrayUtils.sortTest("MergeSort", randomArray);
ArrayUtils.sortTest("QuickSort", quick);
ArrayUtils.sortTest("HeapSort", heap);
//ArrayUtils.sortTest("InsertionSort", insert);
//ArrayUtils.sortTest("SelectionSort", select);
}
}
}