Content-Length: 273066 | pFad | http://github.com/RabibHossain/JavaScriptAlgorithm/commit/85f428e82675bfd4eeb74e4b3a1cf90f8b84013b

96 merge: Add test case to Interpolation Search Algorithm (#1045) · RabibHossain/JavaScriptAlgorithm@85f428e · GitHub
Skip to content

Commit 85f428e

Browse files
Ankush263github-actions
andauthored
merge: Add test case to Interpolation Search Algorithm (TheAlgorithms#1045)
* Add test case to Interpolation Search Algorithm * Updated Documentation in README.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent 59760f7 commit 85f428e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { interpolationSearch } from '../InterpolationSearch'
2+
3+
test('interpolationSearch([2, 6, 8, 14, 122, 169], 144) => -1', () => {
4+
const array = [2, 6, 8, 14, 122, 169]
5+
const key = 144
6+
const res = interpolationSearch(array, key)
7+
expect(res).toEqual(-1)
8+
})
9+
10+
test('interpolationSearch([2, 6, 8, 14, 122, 169], 122) => 4', () => {
11+
const array = [2, 6, 8, 14, 122, 169]
12+
const key = 122
13+
const res = interpolationSearch(array, key)
14+
expect(res).toEqual(4)
15+
})

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/RabibHossain/JavaScriptAlgorithm/commit/85f428e82675bfd4eeb74e4b3a1cf90f8b84013b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy