1809 Commits

Author SHA1 Message Date
c067a34fae fix: GetEuclidGCD(0, 0) is 0 (#1621) 2024-02-28 11:47:22 +05:30
0e0cf98ce7 fix: cleanup CoPrimeCheck (#1609) 2024-02-27 14:24:29 +05:30
fb0a99c15a fix: throw error and add tests for ReverseNumber (#1608) 2024-02-19 19:26:54 +05:30
1ea7a5cd5e test: add missing test for SumOfGeometricProgression (#1607) 2024-02-14 21:13:38 +05:30
10febce31a style: cleanup PascalTriangle (#1606)
* tests: add missing tests for `PascalTriangle`

* style: remove redundant branch in `generate`

* tests: simplify tests of `PascalTriangle`
2024-02-09 22:31:20 +05:30
f31349812c tests: add tests for SHA256 (#1604) 2024-02-09 22:30:47 +05:30
6aaa376500 tests: add tests for SHA1 (#1602)
* tests: add tests for `SHA1`

* style: use `it.each`

---------

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>

---------

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>
2024-01-31 11:37:54 +05:30
cf0004190a docs: add codecov badge (#1600) 2024-01-29 11:00:44 +05:30
1d63400867 chore: add UploadCoverageReport.yml (#1599) 2024-01-27 22:28:12 +05:30
0e5cf5e843 tests: add missing test for KnightTour (#1598) 2024-01-27 22:27:40 +05:30
069803f271 style: remove trailing spaces (#1597) 2024-01-16 12:30:39 +05:30
83eb73b26f chore: update actions/checkout to v4 (#1595) 2024-01-16 00:29:53 +05:30
f0cfa8557f chore: update actions/setup-node to v4 (#1596) 2024-01-16 00:29:36 +05:30
203b7a0aa8 Properly evaluate GITHUB_ACTOR (#1594)
* fix: use `GITHUB_ACTOR` in `git config`

* Updated Documentation in README.md

---------

Co-authored-by: vil02 <vil02@users.noreply.github.com>
2024-01-13 20:55:28 +05:30
5a7e8d1325 implemented CycleDetectionII code in LinkedList (#1482)
* implemented CycleTectionII code

* changes made per review by appgurueu

* made the changes per review by appgurueu

* changes made per review by appgurueu

* did some changes

* fixed the test file with prettier

* Simplify code, renames for clarity

---------

Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-01-04 18:19:13 +05:30
1b66d86bd7 Implemented Palindrome Partitioning using Backtracking algorithm (#1591)
* Implemented Palindrome Partitioning using Backtracking algorithm

* fix:Updated palindromePartition algorithm

* code clean up

* Rephrase doc comment & move to appropriate function

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-11-28 09:58:32 +05:30
39d01138ec Abbreviation (#1547)
* Abbreviation

* Updates from code review
2023-11-15 19:25:30 +05:30
e9e3ea4684 Implemented Partition Problem, Recursive problem (#1582)
* Add Tug of War solution using backtracking

* Updated Documentation in README.md

* Added Tug of war problem link

* Updated Documentation in README.md

* Updated Documentation in README.md

* Refactor tugOfWar: remove unused vars, optimize initialization, and remove redundant checks

* Added Function Export Statment

* Updated Documentation in README.md

* Resolved Code Style --Prettier

* Rename "backtrack" to "recurse"

* Fix test case: The difference needs to be exactly 1.

* Code Modification: subsets should have sizes as close to n/2 as possible

* Updated test-case of TugOfWar

* Changed TugOfWar problem to Partition

* Modified partition problem

* Updated Documentation in README.md

* fixed code style

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-11-15 19:22:57 +05:30
a044c57401 docs: Update script usage in CONTRIBUTING.md (#1587) 2023-11-08 09:16:52 +05:30
cafb3433e8 Update AllCombinationsOfSizeK.js (#1530)
* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.test.js

Changes made it the type of testing. 
Instead of testing the class now the program will test the function

* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.js

* Update AllCombinationsOfSizeK.test.js

* Update AllCombinationsOfSizeK.test.js
2023-10-30 11:10:02 +05:30
1cc5e61ff0 Update Problem001.js (#1536)
* Update Problem001.js

* Update Problem001.js

* Update Problem001.js

* Update Problem001.js

* Update Problem001.js
2023-10-30 11:09:26 +05:30
e5af4c24b4 Enhance readability of ZeroOneKnapsack.js (#1574)
* Enhance readability of ZeroOneKnapsack.js

* Update ZeroOneKnapsack.js

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-30 11:04:06 +05:30
d74f242ac4 Rabin Karp Search Algorithm (#1545)
* Search: Rabin-Karp algorithm

* Prettier Style

* Search: Rabin-Karp adding reference

* Search: Rabin-Karp styling and remove unecessary logging

* Search: Rabin-Karp review notes

* Simplify return

* Updated Documentation in README.md

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-30 11:00:31 +05:30
889d9c361d feat: Added MD5 hashing algorithm (#1519)
* feat: Added MD5 hashing algorithm

* Added wiki link

* Remove spam?

* Fix extend towards end

* Return Uint32Array in MD5 function

* Preprocess function now works on uint arrays

* chunkify U32Array instead of string

* Remove all string related functions

* Replace typed arrays with named variables

* Fix "Replace typed arrays with named variables"

* Return Uint8 Array in MD5 function

The MD5 function now returns a uint8 array with the correct endianness.

* Add tests

* Fix docstrings

* Introduce hexMD5 function

* Change test string

* Format test file
2023-10-30 10:54:35 +05:30
aebd52f39f chore: update readme 2023-10-28 10:53:43 +05:30
28c27d9474 chore: format using prettier 2023-10-28 10:53:43 +05:30
0b9fad86ba fix: CI code style checking 2023-10-28 10:53:43 +05:30
d671327ebe feat: added find subsets algorithm using bitmanipulation (#1514)
* feat: added find subsets algorithm using bitmanipulation

* file name fix

* test file name fix

* fix: codespell fix

* error handled

* added test cases for error
2023-10-26 13:38:19 +00:00
f67cdc3cad Test cases project euler 6 (#1570)
* 📦 NEW: Added solution for ProjectEuler-007

* 🐛 FIX: Spelling mistake fixes

* 👌 IMPROVE: changed variable name from `inc` to `candidateValue` and thrown error in case of invalid input

* 👌 IMPROVE: Modified the code

* 👌 IMPROVE: Added test case for ProjectEuler Problem001

* 👌 IMPROVE: Added test cases for Project Euler Problem 4

* 👌 IMPROVE: auto prettier fixes

* 👌 IMPROVE: added test cases for project euler problem 6

* Updated Documentation in README.md

* Updated Documentation in README.md

---------

Co-authored-by: Omkarnath Parida <omkarnath.parida@yocket.in>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-26 13:35:34 +00:00
9c07bb1107 Test cases project euler 9 (#1571)
* 📦 NEW: Added solution for ProjectEuler-007

* 🐛 FIX: Spelling mistake fixes

* 👌 IMPROVE: changed variable name from `inc` to `candidateValue` and thrown error in case of invalid input

* 👌 IMPROVE: Modified the code

* 👌 IMPROVE: Added test case for ProjectEuler Problem001

* 👌 IMPROVE: Added test cases for Project Euler Problem 4

* 👌 IMPROVE: auto prettier fixes

* 👌 IMPROVE: Added test cases for project euler problem 9

* Updated Documentation in README.md

* Updated Documentation in README.md

---------

Co-authored-by: Omkarnath Parida <omkarnath.parida@yocket.in>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-26 13:34:20 +00:00
9a875264cc prettier fixes & added test cases for Project Euler problem 4 (#1566)
* 📦 NEW: Added solution for ProjectEuler-007

* 🐛 FIX: Spelling mistake fixes

* 👌 IMPROVE: changed variable name from `inc` to `candidateValue` and thrown error in case of invalid input

* 👌 IMPROVE: Modified the code

* 👌 IMPROVE: Added test case for ProjectEuler Problem001

* 👌 IMPROVE: Added test cases for Project Euler Problem 4

* 👌 IMPROVE: auto prettier fixes

---------

Co-authored-by: Omkarnath Parida <omkarnath.parida@yocket.in>
2023-10-24 19:19:37 +02:00
fb134b10b0 Implemented M Coloring Problem (#1562)
* Implemented M Coloring Problem

* Implemented M Coloring Problem

* Switch to a functional approach instead of class-based.
Use proper JSDoc comments.
Refine the comments and remove redundancies.

* Updated Documentation in README.md

* Proper JSDoc comment

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-24 06:48:59 +00:00
7d7f109e6f Enhance readability of KnightTour (#1572) 2023-10-24 06:48:13 +00:00
60443c7eff test: add tests for Binary Equivalent Algorithm (#1560)
* test: add tests for Binary Equivalent Algorithm

* test: Refactored tests using .each()

* Update BinaryEquivalent.test.js

---------

Co-authored-by: {Harshit Malpotra} <{malpotra.harshit@gmail.com}>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-22 17:40:53 +00:00
0315c8a538 docs: fix typo in rotateRight's docstring (#1527) 2023-10-15 17:01:55 +00:00
ad0bde6ddb Update Problem006.js (#1537) 2023-10-15 15:12:09 +00:00
46362e3d47 chore: count set bits using bitwise ops (#1532)
* Update BinaryCountSetBits.js

* Use `let` instead of `var`

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-14 16:54:11 +00:00
628c5aeb5c chore: remove unnecessary code (#1531)
Co-authored-by: IcarusTheFly <IcarusTheFly@users.noreply.github.com>
2023-10-14 16:53:23 +00:00
f77a970c78 updated BinaryHeap.test.js (#1520)
there was a console.log, which is not necessary for test cases.
2023-10-13 14:10:29 +00:00
410009157d feat: add Automorphic Numbers and tests in Math (#1496)
* feat: add automorphic number and tests

* fix: add spaces

* fix: merge tests with test.each
2023-10-12 18:53:40 +00:00
05e32481fa chore: format code (#1515)
* chore: format code

* Updated Documentation in README.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-12 06:32:18 +00:00
ce86248b1e feat: add RGB to HSL color format conversion algorithm (#1475)
* feat: add RGB to HSL color format conversion algorithm

* test: add self-tests for rgb to hsl conversion algorithm

* fix: change function code to concise format

* fix: use throw and segregate the test cases

* chore: clean up the test format

* chore: use correct styling
2023-10-11 06:15:47 +00:00
ca761d87b6 feat: add MergeTwoSortedLinkedLIsts algorithms (#1442)
* feat: add mergeTwoSortedLinkedLIsts algorithms

* remove class and unnecessary function

change the function params and return value from Node to LinkedList.
2023-10-11 06:05:09 +00:00
3823eded0a feat: add row echelon matrix algorithm (#1454)
* feat: add row echelon matrix algorithm

* test: add self-tests for row echelon algorithm

* fix: replace rounding with float tolerance

* chore: use correct style

* fix: use error tolerance and segregate testcases

* chore: add necessary explaining comments
2023-10-11 06:04:33 +00:00
a24450a629 feat: add determinant algorithm (#1438)
* feat: add determinant calculating algorithm

* test: add self-tests for determinant algorithm

* chore: add wikipedia info link

* fix: change initialization to zero

* fix: add error throw and general code improvements

* fix: add error try and catch

* fix: seperate the test loops of error cases

* clean up a bit

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-11 06:03:02 +00:00
13161bdadb feat: Combined Min Heap and Max Heap classes (#1494)
* Combined Min Heap and Max Heap classes

* Added JSdoc comments and also improved tests for binary heap

* Added private methods for BinaryHeap class

* JSDoc knows that a class is a class

I assume the @class tag is for classes implemented via constructor functions, not using ES6 class syntax

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-10 12:44:34 +05:30
c5a25665e0 bug: abs returns 0 on an empty array (#1473)
* bug: update edge case for empty array

* bug: add edge case for empty arrays

* feat: add test case for empty array

---------

Co-authored-by: Ridge Kimani <ridgekimani@gmail.com>
2023-10-10 12:34:09 +05:30
52858f8a09 feat: add algorithm to evaluate postfix string (#1441)
* feat: add algorithm to evaluate postfix strings

* feat: add test case for evaluate expression

* update: add literature reference

* fix: import name in testcase

* fix: test case result

* Make clear that this is postfix

* Update tests

* add: see reference

* fixes mentioned issues

* Fix `default` case

---------

Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-10 12:30:59 +05:30
05750bce43 chore: Add gitpod badge (#1466) 2023-10-10 12:30:31 +05:30
d7dc85232c feat: Key finder improvement (#1456)
* Improve algorithm

* Updated Documentation in README.md

* Updated Documentation in README.md

* Remove unwanted changes

* Make the changes fit

* Updated Documentation in README.md

---------

Co-authored-by: IcarusTheFly <IcarusTheFly@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-10-10 12:29:51 +05:30