From ad587ed68be7b30de2668e9bcadee2814c79f447 Mon Sep 17 00:00:00 2001 From: Anwesha Date: Sat, 24 Oct 2026 18:00:35 +0530 Subject: [PATCH 1/2] Improve Javadoc for LinearSearch find method Updated Javadoc for the find method to clarify return value conditions. --- src/main/java/com/thealgorithms/searches/LinearSearch.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/thealgorithms/searches/LinearSearch.java b/src/main/java/com/thealgorithms/searches/LinearSearch.java index c5f6e6ba9776..3ec1768916e5 100644 --- a/src/main/java/com/thealgorithms/searches/LinearSearch.java +++ b/src/main/java/com/thealgorithms/searches/LinearSearch.java @@ -54,7 +54,8 @@ public class LinearSearch implements SearchAlgorithm { * * @param array List to be searched (can be unsorted) * @param value Key being searched for - * @return Location of the key, -1 if array is null or empty, or key not found + * @return the index of the matching element, or -1 if the array is null or empty, + * the value is null, or no matching element is found; null array elements are skipped */ @Override public > int find(T[] array, T value) { From cbac2a29c1f4a5c6fe49109c53a442f0639203ff Mon Sep 17 00:00:00 2001 From: Anwesha Date: Sat, 24 Oct 2026 19:03:32 +0530 Subject: [PATCH 2/2] Update LinearSearch.java