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) diff --git a/Sorts/FindSecondLargestElement.js b/Sorts/FindSecondLargestElement.js index c87fc99a1e..ed7e63db1a 100644 --- a/Sorts/FindSecondLargestElement.js +++ b/Sorts/FindSecondLargestElement.js @@ -11,7 +11,7 @@ const secondLargestElement = (array) => { const largestElement = Math.max(...array) - let element = 0 + let element = -Number.MAX_VALUE for (let i = 0; i < array.length; i++) { if (element < array[i] && array[i] !== largestElement) {
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: