We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 79bc620 commit f93fc72Copy full SHA for f93fc72
src/main/java/com/thealgorithms/searches/LinearSearch.java
@@ -41,12 +41,12 @@ public class LinearSearch implements SearchAlgorithm {
41
*
42
* @param array List to be searched
43
* @param value Key being searched for
44
- * @return Location of the key, -1 if array is null or empty, or key not found
+ * @return Index of the key if found; otherwise -1 if the array is null, empty, or the key is not found
45
*/
46
@Override
47
public <T extends Comparable<T>> int find(T[] array, T value) {
48
49
- if (array == null || array.length == 0 || value == null) {
+ if (array == null || array.length == 0) {
50
return -1;
51
}
52
0 commit comments