mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-08 12:35:16 +08:00
merge: Fix spellings (#821)
* chore: remove codespell from ci * feat: add codespell workflow * fix: codespell workflow * fix: ignore spellings in directory * chore: fix spellings ./Dynamic-Programming/KadaneAlgo.js:2: contiguos ==> contiguous ./Dynamic-Programming/KadaneAlgo.js:14: posible ==> possible * chore: fix spelling ./Dynamic-Programming/SieveOfEratosthenes.js:4: upto ==> up to * chore: fix spellings ./Dynamic-Programming/MaxNonAdjacentSum.js:22: Exmaple ==> Example * chore: fix spelling ./Project-Euler/test/Problem010.test.js:4: upto ==> up to ./Project-Euler/test/Problem010.test.js:8: upto ==> up to ./Project-Euler/test/Problem010.test.js:12: upto ==> up to * chore: fix spelling ./String/AlphaNumericPalindrome.js:10: recieves ==> receives ./String/AlphaNumericPalindrome.js:10: sting ==> string ./String/AlphaNumericPalindrome.js:46: varaible ==> variable * chore: fix spelling ./String/DiceCoefficient.js:3: stings ==> strings * chore: fix spelling ./String/test/DiceCoefficient.test.js:9: atleast ==> at least * chore: fix spelling ./String/test/MaxWord.test.js:8: ba ==> be * chore: ignore `PermutateString.test.js` * chore: fix spelling ./String/test/CheckVowels.test.js:62: occurances ==> occurrences * chore: ignore `SubsequenceRecursive.js` * chore: fix spelling ./Conversions/TemperatureConversion.js:2: arguement ==> argument * chore: fix spelling ./Conversions/RailwayTimeConversion.js:7: Formate ==> Format ./Conversions/RailwayTimeConversion.js:8: Formate ==> Format * chore: remove Linear Algebra The deleted directory hosted a package which are not accepted by this repository. * Auto-update DIRECTORY.md * chore: fix spelling * chore: fix spellings * merge: Created composite Simpson's integration method. Tests included. (#819) * Created composite Simpson's integration method.Tests included * Minor corrections * Auto-update DIRECTORY.md * Styled with standard.js * chore: remove blank line * chore: remove blank line Co-authored-by: ggkogkou <ggkogkou@ggkogkou.gr> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com> * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: remove codespell from ci * feat: add codespell workflow * fix: codespell workflow * fix: ignore spellings in directory * chore: fix spellings ./Dynamic-Programming/KadaneAlgo.js:2: contiguos ==> contiguous ./Dynamic-Programming/KadaneAlgo.js:14: posible ==> possible * chore: fix spelling ./Dynamic-Programming/SieveOfEratosthenes.js:4: upto ==> up to * chore: fix spellings ./Dynamic-Programming/MaxNonAdjacentSum.js:22: Exmaple ==> Example * chore: fix spelling ./Project-Euler/test/Problem010.test.js:4: upto ==> up to ./Project-Euler/test/Problem010.test.js:8: upto ==> up to ./Project-Euler/test/Problem010.test.js:12: upto ==> up to * chore: fix spelling ./String/AlphaNumericPalindrome.js:10: recieves ==> receives ./String/AlphaNumericPalindrome.js:10: sting ==> string ./String/AlphaNumericPalindrome.js:46: varaible ==> variable * chore: fix spelling ./String/DiceCoefficient.js:3: stings ==> strings * chore: fix spelling ./String/test/DiceCoefficient.test.js:9: atleast ==> at least * chore: fix spelling ./String/test/MaxWord.test.js:8: ba ==> be * chore: ignore `PermutateString.test.js` * chore: fix spelling ./String/test/CheckVowels.test.js:62: occurances ==> occurrences * chore: ignore `SubsequenceRecursive.js` * chore: fix spelling ./Conversions/TemperatureConversion.js:2: arguement ==> argument * chore: fix spelling ./Conversions/RailwayTimeConversion.js:7: Formate ==> Format ./Conversions/RailwayTimeConversion.js:8: Formate ==> Format * chore: remove Linear Algebra The deleted directory hosted a package which are not accepted by this repository. * Auto-update DIRECTORY.md * chore: fix spelling * chore: fix spellings * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: fix spelling * chore: no need to check filenames Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: ggkogkou <76820848+ggkogkou@users.noreply.github.com> Co-authored-by: ggkogkou <ggkogkou@ggkogkou.gr>
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
* [NumberOfLocalMaximumPoints](https://www.geeksforgeeks.org/find-indices-of-all-local-maxima-and-local-minima-in-an-array/) is an algorithm to find relative bigger numbers compared to their neighbors
|
||||
*
|
||||
* Notes:
|
||||
* - like the other similar local maxima search function find relative maxima points in array but doesnt stop at one but returns total point count
|
||||
* - like the other similar local maxima search function find relative maxima points in array but doesn't stop at one but returns total point count
|
||||
* - runs on array A of size n and returns the local maxima count using divide and conquer methodology
|
||||
*
|
||||
* @complexity: O(n) (on average )
|
||||
|
@ -1,17 +1,17 @@
|
||||
import { LocalMaximomPoint } from '../LocalMaximomPoint'
|
||||
|
||||
describe('LocalMaximomPoint tests', () => {
|
||||
it('test boundry maximom points - last element', () => {
|
||||
describe('LocalMaximumPoint tests', () => {
|
||||
it('test boundary maximum points - last element', () => {
|
||||
const Array = [1, 2, 3, 4, 5, 6, 12]
|
||||
expect(LocalMaximomPoint(Array)).toEqual(6)
|
||||
})
|
||||
|
||||
it('test boundry maximom points - first element', () => {
|
||||
it('test boundary maximum points - first element', () => {
|
||||
const Array2 = [13, 6, 5, 4, 3, 2, 1]
|
||||
expect(LocalMaximomPoint(Array2)).toEqual(0)
|
||||
})
|
||||
|
||||
it('test boundry maximom points - should find first maximom point from the top', () => {
|
||||
it('test boundary maximum points - should find first maximom point from the top', () => {
|
||||
// Test a mix of number types (i.e., positive/negative, numbers with decimals, fractions)
|
||||
const Array = [13, 2, 3, 4, 5, 6, 12]
|
||||
expect(LocalMaximomPoint(Array)).toEqual(6)
|
||||
|
@ -1,41 +1,41 @@
|
||||
import { NumberOfLocalMaximumPoints } from '../NumberOfLocalMaximumPoints'
|
||||
|
||||
describe('LocalMaximomPoint tests', () => {
|
||||
it('test boundry maximom points - last element', () => {
|
||||
it('test boundary maximum points - last element', () => {
|
||||
const Array = [1, 2, 3, 4, 5, 6, 12]
|
||||
expect(NumberOfLocalMaximumPoints(Array)).toEqual(1)
|
||||
})
|
||||
|
||||
it('test boundry maximom points - first element', () => {
|
||||
it('test boundary maximum points - first element', () => {
|
||||
const Array = [13, 6, 5, 4, 3, 2, 1]
|
||||
expect(NumberOfLocalMaximumPoints(Array)).toEqual(1)
|
||||
})
|
||||
|
||||
it('test boundry maximom points - both boundries have maximum points', () => {
|
||||
it('test boundary maximum points - both boundaries have maximum points', () => {
|
||||
// Test a mix of number types (i.e., positive/negative, numbers with decimals, fractions)
|
||||
const Array = [13, 2, 3, 4, 5, 6, 12]
|
||||
expect(NumberOfLocalMaximumPoints(Array)).toEqual(2)
|
||||
})
|
||||
|
||||
it('multiple maximom points in the middle', () => {
|
||||
it('multiple maximum points in the middle', () => {
|
||||
// Test a mix of number types (i.e., positive/negative, numbers with decimals, fractions)
|
||||
const Array = [1, 3, 2, 5, 6, 9, 2, 7, 12, 1, 0]
|
||||
expect(NumberOfLocalMaximumPoints(Array)).toEqual(3)
|
||||
})
|
||||
|
||||
it('multiple maximom points in the middle with one at end', () => {
|
||||
it('multiple maximum points in the middle with one at end', () => {
|
||||
// Test a mix of number types (i.e., positive/negative, numbers with decimals, fractions)
|
||||
const Array = [1, 3, 2, 5, 6, 9, 2, 7, 12, 1, 10]
|
||||
expect(NumberOfLocalMaximumPoints(Array)).toEqual(4)
|
||||
})
|
||||
|
||||
it('multiple maximom points in the middle with one at start', () => {
|
||||
it('multiple maximum points in the middle with one at start', () => {
|
||||
// Test a mix of number types (i.e., positive/negative, numbers with decimals, fractions)
|
||||
const Array = [10, 3, 2, 5, 6, 9, 2, 7, 12, 1, 0]
|
||||
expect(NumberOfLocalMaximumPoints(Array)).toEqual(3)
|
||||
})
|
||||
|
||||
it('multiple maximom points in the middle with two more at both ends', () => {
|
||||
it('multiple maximum points in the middle with two more at both ends', () => {
|
||||
// Test a mix of number types (i.e., positive/negative, numbers with decimals, fractions)
|
||||
const Array = [10, 3, 11, 5, 6, 9, 2, 7, 12, 1, 10]
|
||||
expect(NumberOfLocalMaximumPoints(Array)).toEqual(5)
|
||||
|
Reference in New Issue
Block a user