105 Commits

Author SHA1 Message Date
69a397cc33 merge: Added LucasSeries Implementation (#808)
* Added LucasSeries

* Added more tests and renamed function

* Changed RangeError to TypeError
2021-10-25 10:03:02 +05:30
e8d862ca94 merge: Added manhattan distance and euclidean distance for distance 2 points task (#809)
* Added Hex to Binary conversion

* Update Conversions/HexToBinary.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Update Conversions/HexToBinary.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Update Conversions/HexToBinary.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Update Conversions/HexToBinary.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Fix errors

* fix: typo

* Added Manhattan Distance Algorithm

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2021-10-25 09:26:53 +05:30
cd3974c457 merge: Added Sum of GP (#807) 2021-10-23 23:14:01 +05:30
d38ebe5199 chore: Merge pull request #768 from lvlte/issues/720
Changes for consolidation
2021-10-21 19:32:55 +05:30
79c7ce45c8 Fixed != to !== and ran npm run style 2021-10-21 15:57:20 +05:30
56b29cab25 Merge branch 'TheAlgorithms:master' into master 2021-10-21 15:09:26 +05:30
5ccfafecbb npm run style result 2021-10-21 15:06:33 +05:30
fe56f54f82 Added Extended Euclidean Algorithm (ExtendedEuclideanGCD.js) to Maths folder, along with relevant test 2021-10-21 14:58:12 +05:30
8352d260b8 chore: Merge pull request #794 from Badhusha-Akhthaar/master
Added new Mathematical algorithm :  Figurate Numbers
2021-10-21 14:38:25 +05:30
915ca4c7ef Added new Mathematical algorithm , Figurate Numbers
Algorithm for checking whether input number does belong to any type of figurate numbers
2021-10-17 14:12:32 +05:30
ffb138adb1 Minor fixes
- Add default number of iterations
- Correct "corner cases" to "edge cases"
- Make clear which bounds are inclusive and which are exclusive
2021-10-15 12:21:48 -03:00
c5e44d498a A few suggestions / modifications / fixes
It seems you've accidentally swapped the implementation and the test file :)

The overall comment describing the algorithm (VERY nice doc, by the way) is not "proper" JSdoc => only one leading asterisk. It's generally considered good style to start a comment block (both JSdoc and regular comments) with a single, short sentence.

Further down, there were some git hiccups, most likely caused by merge conflicts?
2021-10-14 22:32:56 +02:00
3c2fdf7582 Add Fermat Primality Test 2021-10-14 15:15:49 -03:00
3f32320c85 Comply with ESM. Convert live code example to Jest test. 2021-10-09 13:25:34 +02:00
cbe7e0c89f Comply with ESM syntax. 2021-10-09 13:18:40 +02:00
b13b12e88c chore: merge Fix/742 migrate doctest to jest (#749)
* Remove QuickSelect doctest

There are more Jest test cases already.

* Remove AverageMedian doctest

Already migrated to jest

* Migrate doctest for BinaryExponentiationRecursive.js

(also remove inline "main" test method)

* Migrate doctest for EulersTotient.js

(also remove inline "main" test method)

* Migrate doctest for PrimeFactors.js

(also remove inline "main" test method)

* Migrate doctest for BogoSort.js

Re-write prototype-polluting helper methods, too.

(also remove inline test driver code)

* Migrate doctest for BeadSort.js

(also remove inline test driver code)

* Migrate doctest for BucketSort.js

(also remove inline test driver code)

* Migrate doctest for CocktailShakerSort.js

(also remove inline test driver code)

* Migrate doctest for MergeSort.js

(also remove inline test driver code)

* Migrate doctest for QuickSort.js

(also remove inline test driver code)

* Migrate doctest for ReverseString.js

(also remove inline test driver code)

* Migrate doctest for ReverseString.js

* Migrate doctest for ValidateEmail.js

* Migrate doctest for ConwaysGameOfLife.js

(remove the animate code, too)

* Remove TernarySearch doctest

Already migrated to jest

* Migrate doctest for BubbleSort.js

(also remove inline test driver code)

* Remove doctest from CI and from dependencies

relates to #742
fixes #586

* Migrate doctest for RgbHsvConversion.js

* Add --fix option to "standard" npm script

* Migrate doctest for BreadthFirstSearch.js

(also remove inline test driver code)

* Migrate doctest for BreadthFirstShortestPath.js

(also remove inline test driver code)

* Migrate doctest for EulerMethod.js

(also remove inline test driver code)

Move manual test-code for plotting stuff in the browser in a distinct file, too. Those "*.manual-test.js" files are excluded from the UpdateDirectory.mjs script, as well.

* Migrate doctest for Mandelbrot.js

(also remove inline test driver code & moved manual drawing test into a *.manual-test.js)

* Migrate doctest for FloodFill.js

* Migrate doctest for KochSnowflake.js

(also move manual drawing test into a *.manual-test.js)

* Update npm lockfile

* Update README and COMMITTING with a few bits & bobs regarding testing & code quality
2021-10-07 12:33:38 +05:30
82d1c2a6bd Merge branch 'master' into master 2021-10-06 00:00:47 +06:00
1589263947 fixed some spellings 2021-10-05 12:49:23 +05:30
bf088c0646 add an algorithm for checking a year is a leap year or not 2021-10-04 01:20:08 +06:00
b3b4ad43a3 chore: Added Sum of Digits Implementation (#684)
* Added the main logic, need to work on Tests

* Added tests for SOD

* Fix typo and add Wikipedia link in comments

* Fix mistake in SumOfDigitsUsingStrings

I intended to initially write a different implementation but I wrote something else 🤦‍♂️

* Converted Spacing from Tabs to Spaces

* Oops, forgot about the test file

* Fixed semicolon problems...

* Oops, I missed a few semicolons

* Linting is hell TwT

Co-authored-by: SpiderMath <{ID}+{username}@users.noreply.github.com>
2021-09-13 19:41:28 +05:30
75f184641a Update Coordinate.test.js
Re-upload of code after standard --fix
2021-07-27 16:16:07 +08:00
cba900e628 Create Coordinate.test.js
Previous submission for the similar file in pull request #646 was deleted accidentally. This is a reupload with correct coding that passed local test.
2021-07-27 15:53:59 +08:00
23714cb154 Update Volume.test.js 2021-07-20 15:08:31 +08:00
5d62b4aa1b Update Volume.test.js 2021-07-20 15:03:22 +08:00
fe5e939bb9 Update Volume.test.js 2021-07-20 14:52:19 +08:00
48fec3d571 Update Volume.test.js 2021-07-20 14:41:25 +08:00
45cde7a4aa Update Volume.test.js 2021-07-20 14:25:24 +08:00
ab761ec892 Added Volume.test.js file
Volume.test.js file is to test on the calculations for the Volume.js file.
2021-07-20 14:14:53 +08:00
e5b7e56f00 chore: Strict equal for tests 2021-07-19 13:25:00 +05:30
d41b6aade5 chore: Update test values 2021-07-19 13:21:35 +05:30
6ac0d61185 style: update style 2021-07-19 13:17:06 +05:30
cd061ccf25 chore: add tests. 2021-07-19 13:12:47 +05:30
937b472dfa Update AverageMedian.js and AverageMedian.test.js 2021-07-19 13:34:38 +08:00
04b71c337a Update AverageMedian.js and added AverageMedian.test.js 2021-07-19 12:44:48 +08:00
a55248a3b7 Added RadianToDegree.js and RadianToDegree.test.js in Maths directory 2021-07-10 14:42:53 +05:30
ec37421591 Added DegreeToRadian.js and DegreeToRadian.test.js in Maths directory 2021-07-09 22:15:43 +05:30
709de83feb Added jest file in tests, added description and normal even number test(divisibility by 2 ) 2021-07-03 18:27:43 +05:30
6d8b134ce7 Formatted with standard 2021-05-23 18:09:39 +09:00
cf5ff92ef9 Add tests for Maths/IsDivisible 2021-05-05 14:23:50 +09:00
c8ab618d00 Merge pull request #477 from Eji4h/master
Refactor Maths/Factorial for more minimal side effects.
2021-01-22 15:44:51 +05:30
8b1e32eb77 Add extra testcases for Fibonacci and improve code (#544)
* Add extra testcases for Fibonacci and improve code
* Fix typos in Fibonacci.js
2020-12-20 22:24:02 +05:30
2ebe65baff Add Pow.js (#498)
* Add pow.js

* Add tests for Pow.js
2020-12-20 19:08:37 +05:30
4746d0c90e some changes in coding style to make it standerize 2020-12-14 12:26:08 +05:30
ee749bde47 Added EulersTotientFunction function to the Maths Folder 2020-12-14 00:33:55 +05:30
7a050aba5b Merge pull request #531 from rahul1995/fib-matrix-expo
Add O(log n) algorithm using matrix exponentiation to find n-th fibonacci
2020-11-01 08:55:10 +05:30
eab57b880a add binary convert (#521)
* add  binary convert
2020-10-31 20:22:50 +05:30
9c9640c1c3 Added Softmax to Maths folder (#516) 2020-10-31 12:20:29 +05:30
78a05970e2 Add O(log n) algorithm using matrix exponentiation to find n-th fibonacci 2020-10-30 16:02:15 +05:30
5e6d813b6f Update Binary Exponentiation algorithm file to comply with Javascript standard rules 2020-10-29 21:54:07 +05:30
ae3bd72ca8 Add Iterative Binary Exponentiation 2020-10-29 21:36:31 +05:30