mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
style: include OCP_OVERLY_CONCRETE_PARAMETER (#5833)
This commit is contained in:
@@ -183,7 +183,7 @@ public class BoruvkaAlgorithmTest {
|
||||
* @param result list of edges in the Minimum Spanning Tree
|
||||
* @return the total weight of the Minimum Spanning Tree
|
||||
*/
|
||||
int computeTotalWeight(final List<BoruvkaAlgorithm.Edge> result) {
|
||||
int computeTotalWeight(final Iterable<BoruvkaAlgorithm.Edge> result) {
|
||||
int totalWeight = 0;
|
||||
for (final var edge : result) {
|
||||
totalWeight += edge.weight;
|
||||
|
||||
@@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -25,7 +26,7 @@ public class EdmondsBlossomAlgorithmTest {
|
||||
* @param matching List of matched pairs returned by the algorithm.
|
||||
* @return A sorted 2D array of matching pairs.
|
||||
*/
|
||||
private int[][] convertMatchingToArray(List<int[]> matching) {
|
||||
private int[][] convertMatchingToArray(Collection<int[]> matching) {
|
||||
// Convert the list of pairs into an array
|
||||
int[][] result = matching.toArray(new int[0][]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user