FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScript/Maths/test/FindMaxRecursion.test.js at master · TheAlgorithms/JavaScript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
TheAlgorithms
/
JavaScript
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
5.8k
Star
34.2k
Code
Issues
21
Pull requests
192
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScript
/
Maths
/
test
/
FindMaxRecursion.test.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (49 loc) · 1.54 KB
Breadcrumbs
JavaScript
/
Maths
/
test
/
FindMaxRecursion.test.js
Copy path
File metadata and controls
58 lines (49 loc) · 1.54 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import
{
findMaxRecursion
}
from
'../FindMaxRecursion'
describe
(
'Test findMaxRecursion function'
,
(
)
=>
{
const
positiveAndNegativeArray
=
[
1
,
2
,
4
,
5
,
-
1
,
-
2
,
-
4
,
-
5
]
const
positiveAndNegativeArray1
=
[
10
,
40
,
100
,
20
,
-
10
,
-
40
,
-
100
,
-
20
]
const
positiveArray
=
[
1
,
2
,
4
,
5
]
const
positiveArray1
=
[
10
,
40
,
100
,
20
]
const
negativeArray
=
[
-
1
,
-
2
,
-
4
,
-
5
]
const
negativeArray1
=
[
-
10
,
-
40
,
-
100
,
-
20
]
const
zeroArray
=
[
0
,
0
,
0
,
0
]
const
emptyArray
=
[
]
it
(
'Testing with positive arrays'
,
(
)
=>
{
expect
(
findMaxRecursion
(
positiveArray
,
0
,
positiveArray
.
length
-
1
)
)
.
toBe
(
5
)
expect
(
findMaxRecursion
(
positiveArray1
,
0
,
positiveArray1
.
length
-
1
)
)
.
toBe
(
100
)
}
)
it
(
'Testing with negative arrays'
,
(
)
=>
{
expect
(
findMaxRecursion
(
negativeArray
,
0
,
negativeArray
.
length
-
1
)
)
.
toBe
(
-
1
)
expect
(
findMaxRecursion
(
negativeArray1
,
0
,
negativeArray1
.
length
-
1
)
)
.
toBe
(
-
10
)
}
)
it
(
'Testing with positive and negative arrays'
,
(
)
=>
{
expect
(
findMaxRecursion
(
positiveAndNegativeArray
,
0
,
positiveAndNegativeArray
.
length
-
1
)
)
.
toBe
(
5
)
expect
(
findMaxRecursion
(
positiveAndNegativeArray1
,
0
,
positiveAndNegativeArray1
.
length
-
1
)
)
.
toBe
(
100
)
}
)
it
(
'Testing with zero arrays'
,
(
)
=>
{
expect
(
findMaxRecursion
(
zeroArray
,
0
,
zeroArray
.
length
-
1
)
)
.
toBe
(
0
)
}
)
it
(
'Testing with empty arrays'
,
(
)
=>
{
expect
(
findMaxRecursion
(
emptyArray
,
0
,
emptyArray
.
length
-
1
)
)
.
toBe
(
undefined
)
}
)
}
)
Back
|
FazBrowse Home
|
New Git URL