Skip to content
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fba34e6
Create RecursiveLinearSearch.js
debnath003 Oct 3, 2023
c865c35
Create RecursiveLinearSearch.test.js
debnath003 Oct 3, 2023
00c13af
Update RecursiveLinearSearch.js
debnath003 Oct 3, 2023
3185e53
Update RecursiveLinearSearch.js
debnath003 Oct 3, 2023
8e77a5e
Update RecursiveLinearSearch.js
debnath003 Oct 3, 2023
a6dd54f
Update RecursiveLinearSearch.js
debnath003 Oct 3, 2023
c1961f1
Update RecursiveLinearSearch.js
debnath003 Oct 3, 2023
a839184
Update RecursiveLinearSearch.test.js
debnath003 Oct 3, 2023
c1b4f0c
Delete Recursive/RecursiveLinearSearch.js
debnath003 Oct 3, 2023
dd8cb8f
Delete Recursive/test/RecursiveLinearSearch.test.js
debnath003 Oct 3, 2023
aaef3a8
Create Rectangle.js
debnath003 Oct 3, 2023
82e00cb
Update Rectangle.js
debnath003 Oct 3, 2023
2109aa6
Create Rectangle.test.js
debnath003 Oct 3, 2023
72765bd
Update Rectangle.js
debnath003 Oct 3, 2023
197cf3c
Delete Geometry/Rectangle.js
debnath003 Oct 3, 2023
3e36938
Delete Geometry/Test/Rectangle.test.js
debnath003 Oct 3, 2023
860dda7
Create CircularDoublyLinkedList.js
debnath003 Oct 3, 2023
9bdaf7d
Update CircularDoublyLinkedList.js
debnath003 Oct 3, 2023
834cd1b
Update CircularDoublyLinkedList.js
debnath003 Oct 3, 2023
12ec96e
Create CircularDoublyLinkedList.test.js
debnath003 Oct 3, 2023
b1f967a
Update CircularDoublyLinkedList.test.js
debnath003 Oct 3, 2023
808d740
Update CircularDoublyLinkedList.js
debnath003 Oct 3, 2023
393e591
Update CircularDoublyLinkedList.test.js
debnath003 Oct 3, 2023
46b572e
Update CircularDoublyLinkedList.js
debnath003 Oct 3, 2023
476aae1
Update CircularDoublyLinkedList.test.js
debnath003 Oct 3, 2023
4997d01
Update CircularDoublyLinkedList.test.js
debnath003 Oct 3, 2023
627c3ff
Update CircularDoublyLinkedList.js
debnath003 Oct 3, 2023
6eb5856
Update CircularDoublyLinkedList.test.js
debnath003 Oct 3, 2023
21c42c9
Clean up tests a bit
appgurueu Oct 4, 2023
eac5a0f
missed one "Check"
appgurueu Oct 4, 2023
1424735
createIterator -> elements
appgurueu Oct 4, 2023
aba8600
Replace toArray with elements iterator
appgurueu Oct 4, 2023
ab99a65
Remove `toArray` test
appgurueu Oct 4, 2023
42b8013
Remove usages of `toArray` in other tests
appgurueu Oct 4, 2023
9355002
Update CircularDoublyLinkedList.js
debnath003 Oct 9, 2023
3a2de53
Update CircularDoublyLinkedList.test.js
debnath003 Oct 9, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update RecursiveLinearSearch.js
  • Loading branch information
debnath003 authored Oct 3, 2023
commit c1961f1814bb6e33cccfc8a14914cdf65c58e59f
8 changes: 4 additions & 4 deletions Recursive/RecursiveLinearSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
function recursiveLinearSearch (arr, key, index = 0) {
// Base case: If we have searched the entire array and haven't found the key, return -1.
if (index === arr.length) {
return -1;
return -1
}

// Base case: If the current element matches the key, return its index.
if (arr[index] === key) {
return index;
return index
}

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

export { recursiveLinearSearch };
export { recursiveLinearSearch }