Skip to content

Commit 773d745

Browse files
Improve Javadoc for LinearSearch find method (#7657)
Co-authored-by: Oleksandr Klymenko <19151554+alxkm@users.noreply.github.com>
1 parent 3d71df9 commit 773d745

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/main/java/com/thealgorithms/searches/LinearSearch.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public class LinearSearch implements SearchAlgorithm {
5454
*
5555
* @param array List to be searched (can be unsorted)
5656
* @param value Key being searched for
57-
* @return Location of the key, -1 if array is null or empty, or key not found
57+
* @return the index of the matching element, or -1 if the array is null or empty,
58+
* the value is null, or no matching element is found; null array elements are skipped
5859
*/
5960
@Override
6061
public <T extends Comparable<T>> int find(T[] array, T value) {

0 commit comments

Comments
 (0)