We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3185e53 commit 8e77a5eCopy full SHA for 8e77a5e
Recursive/RecursiveLinearSearch.js
@@ -13,16 +13,16 @@
13
function recursiveLinearSearch (arr, key, index = 0) {
14
// Base case: If we have searched the entire array and haven't found the key, return -1.
15
if (index === arr.length) {
16
- return -1;;
+ return -1 ;;
17
}
18
19
// Base case: If the current element matches the key, return its index.
20
if (arr[index] === key) {
21
- return index;;
+ return index ;;
22
23
24
// Recursive case: Continue searching in the rest of the array.
25
- return recursiveLinearSearch(arr, key, index + 1);;
+ return recursiveLinearSearch(arr, key, index + 1) ;;
26
27
28
-export { recursiveLinearSearch };;
+export { recursiveLinearSearch } ;;
0 commit comments