Skip to content

Commit 5636a00

Browse files
committed
Fix eslint issues
1 parent 0bc0253 commit 5636a00

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/algorithms/search/interpolation_search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const interpolationsearch = (sortedArray, element) => {
1313
const posDiff = right - left;
1414
const elementDiff = element - sortedArray[left];
1515

16-
const pos = left + (posDiff * elementDiff / valDiff || 0);
16+
const pos = left + ((posDiff * elementDiff) / valDiff || 0);
1717

1818
if (sortedArray[pos] === element) {
1919
return pos;

test/algorithms/search/testInterpolationSearch.js

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ describe('Interpolation Search', () => {
4949

5050
it('should check for edge case where array contains all duplicate values', () => {
5151
const duplicateArray = [42, 42, 42, 42];
52-
5352
assert.equal(interpolationsearch(duplicateArray, 6), -1);
5453
assert.equal(interpolationsearch(duplicateArray, 42), 0);
5554
});

0 commit comments

Comments
 (0)