We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f16f6eb commit 537f4a9Copy full SHA for 537f4a9
src/main/java/com/thealgorithms/scheduling/RandomScheduling.java
@@ -1,6 +1,7 @@
1
package com.thealgorithms.scheduling;
2
3
import java.util.ArrayList;
4
+import java.util.Collection;
5
import java.util.Collections;
6
import java.util.List;
7
import java.util.Random;
@@ -23,10 +24,10 @@ public final class RandomScheduling {
23
24
/**
25
* Constructs a new RandomScheduling instance.
26
*
- * @param tasks A list of task names to be scheduled.
27
+ * @param tasks A collection of task names to be scheduled.
28
* @param random A Random instance for generating random numbers.
29
*/
- public RandomScheduling(List<String> tasks, Random random) {
30
+ public RandomScheduling(Collection<String> tasks, Random random) {
31
this.tasks = new ArrayList<>(tasks); // Store tasks locally
32
this.random = random;
33
}
0 commit comments