-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRandomSeed.java
More file actions
39 lines (28 loc) · 916 Bytes
/
RandomSeed.java
File metadata and controls
39 lines (28 loc) · 916 Bytes
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
36
37
38
39
package main.sorting;
import lombok.ToString;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
@ToString
public class RandomSeed {
private static final Random RANDOW = new Random();
public RandomSeed() {
this.problemSize = 15;
this.testData = new ArrayList<Integer>(problemSize);
}
public RandomSeed(int problemSize) {
this.problemSize = problemSize;
this.testData = new ArrayList<Integer>(problemSize);
}
private int problemSize;
private List<Integer> testData;
// int[] testData = new int[]{29,62,28,78,83,91,96,64,27,64};
public Integer[] getRandomSeedForSorting(Integer range) {
Integer[] a = new Integer[problemSize];
for (int i = 0; i < problemSize; i++) {
testData.add(RANDOW.nextInt(range));
}
return testData.toArray(a);
}
}