1830 Commits

Author SHA1 Message Date
e2b9754862 tests: add tests of LongestIncreasingSubsequence (#1660) 2024-05-23 19:45:08 +02:00
cc1e1dc643 GitHub Actions: Test on the current version of Node.js (#1657) 2024-05-17 17:28:38 +02:00
6bb02af09b Updated Documentation in README.md 2024-05-16 17:05:42 +02:00
6e27235fb7 Keep GitHub Actions up to date with GitHub's Dependabot
Fixes software supply chain safety warnings like at the bottom right of
https://github.com/TheAlgorithms/JavaScript/actions/runs/8960545794

* [Keeping your actions up to date with Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot)
* [Configuration options for the dependabot.yml file - package-ecosystem](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem)
2024-05-16 17:05:42 +02:00
6fe21d21e9 chore: convert functions to an ES2015 classes (#1656)
* chore: convert functions to an ES2015 classes

* remove unnecessary functions
2024-04-13 23:21:54 +05:30
314144fae6 Update CircularQueue.js for zero-length case (#1655)
* Update CircularQueue.js

* Update CircularQueue.js

Taking comments into account for refactoring my change.

* Update CircularQueue.js

Adding "this" to checkEmpty()
2024-04-03 20:55:30 +05:30
d920e7f427 refactor: reduce code duplication in FloodFill (#1645)
* tests: add tests checking if floodFill funtions throw when location is outside

* refactor: reduce code duplication by adding `checkLocation` to `FloodFill`

* refactor: add and use `isInside`

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

* Deduplicate further

---------

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>
2024-04-03 20:54:06 +05:30
d02e402972 removed code already present in test cases related to DFT in Trees folder (#1648) 2024-04-03 20:50:00 +05:30
9c622dd089 refactor: add and use parseDate (#1643)
* refactor: add and use `parseDate`

* style: use proper spelling

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

---------

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>
2024-04-03 20:49:26 +05:30
34a663aca7 fix: hadnle zeros at the endpoints in BisectionMethod (#1640)
* fix: hadnle zeros at the endpoints

* style: use simpler syntax express polynomials

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

---------

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>
2024-04-03 20:48:45 +05:30
702840b4c8 style: improve test names of GetEuclidGCD' (#1646) 2024-03-28 16:42:40 +05:30
bd34e9fa61 feat: remove duplicated gcd-like functions (#1642)
* feat: remove duplicated `gcd`-like functions

* Updated Documentation in README.md

---------

Co-authored-by: vil02 <vil02@users.noreply.github.com>
2024-03-16 09:29:14 +05:30
0204198465 feat: remove twinPrime (#1641)
* tests: add missing test of `twinPrime`

* feat: remove `twinPrime`
2024-03-12 01:56:29 +05:30
4a4ed57d42 refactor: use isLeapYear (#1638) 2024-03-07 10:23:43 +05:30
d8cfdcd800 chore: use check-style in (#1630) 2024-03-05 03:37:16 +05:30
f13eec1bbb fix: properly floor the partial results (#1629) 2024-03-05 03:36:50 +05:30
2fe0dfde23 fix: throw form DateToDay (#1628) 2024-03-05 03:33:19 +05:30
83b4dd8290 fix: cleanup CheckKishnamurthyNumber (#1626) 2024-03-02 13:25:14 +05:30
894a46ca67 fix: throw error instead of returning it RailwayTimeConversion (#1625) 2024-03-02 13:24:46 +05:30
8734dfccf9 fix: handle zeros in CoPrimeCheck (#1622) 2024-02-29 10:36:08 +05:30
a5945e37c2 fix: throw error instead of returning it (#1624) 2024-02-29 10:25:11 +05:30
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