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:
@@ -13,7 +13,7 @@ public final class MedianOfMatrix {
|
||||
private MedianOfMatrix() {
|
||||
}
|
||||
|
||||
public static int median(List<List<Integer>> matrix) {
|
||||
public static int median(Iterable<List<Integer>> matrix) {
|
||||
// Flatten the matrix into a 1D list
|
||||
List<Integer> linear = new ArrayList<>();
|
||||
for (List<Integer> row : matrix) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.thealgorithms.misc;
|
||||
|
||||
import com.thealgorithms.datastructures.lists.SinglyLinkedList;
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
@@ -15,8 +14,8 @@ public final class PalindromeSinglyLinkedList {
|
||||
private PalindromeSinglyLinkedList() {
|
||||
}
|
||||
|
||||
public static boolean isPalindrome(final SinglyLinkedList linkedList) {
|
||||
Stack<Integer> linkedListValues = new Stack<>();
|
||||
public static boolean isPalindrome(final Iterable linkedList) {
|
||||
var linkedListValues = new Stack<>();
|
||||
|
||||
for (final var x : linkedList) {
|
||||
linkedListValues.push(x);
|
||||
|
||||
Reference in New Issue
Block a user