Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit85f428e

Browse files
Ankush263github-actions
and
github-actions
authored
merge: Add test case to Interpolation Search Algorithm (#1045)
* Add test case to Interpolation Search Algorithm* Updated Documentation in README.mdCo-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent59760f7 commit85f428e

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+
constarray=[2,6,8,14,122,169]
5+
constkey=144
6+
constres=interpolationSearch(array,key)
7+
expect(res).toEqual(-1)
8+
})
9+
10+
test('interpolationSearch([2, 6, 8, 14, 122, 169], 122) => 4',()=>{
11+
constarray=[2,6,8,14,122,169]
12+
constkey=122
13+
constres=interpolationSearch(array,key)
14+
expect(res).toEqual(4)
15+
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp