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:
@@ -94,7 +94,7 @@ public final class AStar {
|
||||
}
|
||||
|
||||
// Initializes the graph with edges defined in the input data
|
||||
static void initializeGraph(Graph graph, ArrayList<Integer> data) {
|
||||
static void initializeGraph(Graph graph, List<Integer> data) {
|
||||
for (int i = 0; i < data.size(); i += 4) {
|
||||
graph.addEdge(new Edge(data.get(i), data.get(i + 1), data.get(i + 2)));
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public final class EdmondsBlossomAlgorithm {
|
||||
* @param vertexCount The number of vertices in the graph.
|
||||
* @return A list of matched pairs of vertices.
|
||||
*/
|
||||
public static List<int[]> maximumMatching(List<int[]> edges, int vertexCount) {
|
||||
public static List<int[]> maximumMatching(Iterable<int[]> edges, int vertexCount) {
|
||||
List<List<Integer>> graph = new ArrayList<>(vertexCount);
|
||||
|
||||
// Initialize each vertex's adjacency list.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.datastructures.lists;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -38,7 +39,7 @@ public final class MergeSortedArrayList {
|
||||
* @param listB the second list to merge
|
||||
* @param listC the result list after merging
|
||||
*/
|
||||
public static void merge(List<Integer> listA, List<Integer> listB, List<Integer> listC) {
|
||||
public static void merge(List<Integer> listA, List<Integer> listB, Collection<Integer> listC) {
|
||||
int pa = 0;
|
||||
/* the index of listA */
|
||||
int pb = 0;
|
||||
|
||||
Reference in New Issue
Block a user