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

Commit 398b682

Browse files
Ankush263github-actions
and
github-actions
authored
merge: Add test case to the Exponential Search Algorithm (#1040)
* Add test case to the Exponential Search Algorithm * Updated Documentation in README.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent d3cec8b commit 398b682

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 { exponentialSearch } from '../ExponentialSearch'
2+
3+
test('The Exponential Search of the Array [2, 3, 4, 10, 40, 65, 78, 100] is 6 where the value = 78', () => {
4+
const arr = [2, 3, 4, 10, 40, 65, 78, 100]
5+
const value = 78
6+
const result = exponentialSearch(arr, arr.length, value)
7+
expect(result).toEqual(6)
8+
})
9+
10+
test('The Exponential Search of the Array [2, 3, 4, 10, 40, 65, 78, 100] is -1 where the value = 178', () => {
11+
const arr = [2, 3, 4, 10, 40, 65, 78, 100]
12+
const value = 178
13+
const result = exponentialSearch(arr, arr.length, value)
14+
expect(result).toEqual(-1)
15+
})

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /