Skip to content

Commit

Permalink
TernarySearch tests added, 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashyap committed Oct 5, 2019
1 parent e29c323 commit 8b5a29c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/algorithms/search/testTernarySearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ describe('Ternary Search', () => {

assert.equal(index, 4);
});

it('should return index of element between two mid points', () => {
const index = ternarysearch([2, 3, 4, 5, 6, 8, 10], 5);
assert.equal(index, 3);
});
});

0 comments on commit 8b5a29c

Please sign in to comment.