Skip to content

Commit 8e77a5e

Browse files
authored
Update RecursiveLinearSearch.js
1 parent 3185e53 commit 8e77a5e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Recursive/RecursiveLinearSearch.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
function recursiveLinearSearch (arr, key, index = 0) {
1414
// Base case: If we have searched the entire array and haven't found the key, return -1.
1515
if (index === arr.length) {
16-
return -1;;
16+
return -1 ;;
1717
}
1818

1919
// Base case: If the current element matches the key, return its index.
2020
if (arr[index] === key) {
21-
return index;;
21+
return index ;;
2222
}
2323

2424
// Recursive case: Continue searching in the rest of the array.
25-
return recursiveLinearSearch(arr, key, index + 1);;
25+
return recursiveLinearSearch(arr, key, index + 1) ;;
2626
}
2727

28-
export { recursiveLinearSearch };;
28+
export { recursiveLinearSearch } ;;

0 commit comments

Comments
 (0)