From 304df3a563f8dafc5c1c1a406023633ae7fd2166 Mon Sep 17 00:00:00 2001 From: Ankush263 Date: Tue, 7 Jun 2022 14:56:04 +0530 Subject: [PATCH 1/2] Add test case to the Exponential Search Algorithm --- Search/test/ExponentialSearch.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Search/test/ExponentialSearch.test.js diff --git a/Search/test/ExponentialSearch.test.js b/Search/test/ExponentialSearch.test.js new file mode 100644 index 0000000000..cca5d82dab --- /dev/null +++ b/Search/test/ExponentialSearch.test.js @@ -0,0 +1,15 @@ +import { exponentialSearch } from '../ExponentialSearch' + +test('The Exponential Search of the Array [2, 3, 4, 10, 40, 65, 78, 100] is 6 where the value = 78', () => { + const arr = [2, 3, 4, 10, 40, 65, 78, 100] + const value = 78 + const result = exponentialSearch(arr, arr.length, value) + expect(result).toEqual(6) +}) + +test('The Exponential Search of the Array [2, 3, 4, 10, 40, 65, 78, 100] is -1 where the value = 178', () => { + const arr = [2, 3, 4, 10, 40, 65, 78, 100] + const value = 178 + const result = exponentialSearch(arr, arr.length, value) + expect(result).toEqual(-1) +}) From 08d65bbd051892ad818afc96449801e2156203ab Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Tue, 7 Jun 2022 09:31:00 +0000 Subject: [PATCH 2/2] Updated Documentation in README.md --- DIRECTORY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index df10ce16c0..315810f062 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -142,6 +142,7 @@ * [BinaryExponentiationRecursive](Maths/BinaryExponentiationRecursive.js) * [BisectionMethod](Maths/BisectionMethod.js) * [CheckKishnamurthyNumber](Maths/CheckKishnamurthyNumber.js) + * [CollatzSequence](Maths/CollatzSequence.js) * [Coordinate](Maths/Coordinate.js) * [CoPrimeCheck](Maths/CoPrimeCheck.js) * [DecimalExpansion](Maths/DecimalExpansion.js) @@ -159,6 +160,7 @@ * [FigurateNumber](Maths/FigurateNumber.js) * [FindHcf](Maths/FindHcf.js) * [FindLcm](Maths/FindLcm.js) + * [FindMaxRecursion](Maths/FindMaxRecursion.js) * [FindMin](Maths/FindMin.js) * [FindMinIterator](Maths/FindMinIterator.js) * [GetEuclidGCD](Maths/GetEuclidGCD.js) @@ -166,6 +168,7 @@ * [IsDivisible](Maths/IsDivisible.js) * [IsEven](Maths/IsEven.js) * [IsOdd](Maths/IsOdd.js) + * [IsPronic](Maths/IsPronic.js) * [LeapYear](Maths/LeapYear.js) * [LinearSieve](Maths/LinearSieve.js) * [LucasSeries](Maths/LucasSeries.js) @@ -197,6 +200,7 @@ * [SquareRoot](Maths/SquareRoot.js) * [SumOfDigits](Maths/SumOfDigits.js) * [SumOfGeometricProgression](Maths/SumOfGeometricProgression.js) + * [TwinPrime](Maths/TwinPrime.js) * [Volume](Maths/Volume.js) * [WhileLoopFactorial](Maths/WhileLoopFactorial.js) * [ZellersCongruenceAlgorithm](Maths/ZellersCongruenceAlgorithm.js)