34 Commits

Author SHA1 Message Date
1554ba5f9c test: add tests for NumberOfSubsetEqualToGivenSum (#1661) 2024-05-25 16:31:54 +05:30
e2b9754862 tests: add tests of LongestIncreasingSubsequence (#1660) 2024-05-23 19:45:08 +02:00
39d01138ec Abbreviation (#1547)
* Abbreviation

* Updates from code review
2023-11-15 19:25:30 +05:30
86d333ee94 feat: Test running overhaul, switch to Prettier & reformat everything (#1407)
* chore: Switch to Node 20 + Vitest

* chore: migrate to vitest mock functions

* chore: code style (switch to prettier)

* test: re-enable long-running test

Seems the switch to Node 20 and Vitest has vastly improved the code's and / or the test's runtime!

see #1193

* chore: code style

* chore: fix failing tests

* Updated Documentation in README.md

* Update contribution guidelines to state usage of Prettier

* fix: set prettier printWidth back to 80

* chore: apply updated code style automatically

* fix: set prettier line endings to lf again

* chore: apply updated code style automatically

---------

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-04 02:38:19 +05:30
6aa3314b93 fix: fixed error in the MaxProductOfThree algorithm (#1295)
* fix: fixed error in the MaxProductOfThree algorithm

Fixed the error in the MaxProductOfThree by initializing the max and min
variables to null instead of -1. The checks were then altered to check
for null instead of -1.

Also wrote more tests, which randomly generated small arrays and
compared the output of the maxProductOfThree-algorithm to the output of
a slower, but complete, function which calculates all posible
triple-products of the values of the array.

Fixes: #1294

* fix: Added newlines at the end of the files
2023-02-19 01:05:07 +05:30
5668e64b29 algorithm: unique paths 2 (#1257)
* algorithm: add UniquePaths2 algo and a test for it

* fix: fix inaccuracies and spelling errors
2022-10-31 22:37:26 +05:30
21d73b6447 algorithm: unique paths (#1211)
* dp problem

* update Directory.md

* suggested changes
2022-10-20 20:29:36 +05:30
e65211299b feature: add fast fibonacci algorithm (#1155) 2022-10-17 01:54:44 +05:30
ede60b81d9 algorithm: catalan numbers (#1149) 2022-10-09 17:45:26 +05:30
ea7d06ad57 tests: Levenshtein Distance (dynamic programming solution) (#1114) 2022-10-06 00:38:23 +05:30
9528c71107 Added testcases for Zero One Knapsack (#1109) 2022-10-02 11:19:31 +05:30
59760f75c4 merge: Add test case to Edit Distance Algorithm (#1044)
* Add test case to Edit Distance Algorithm

* Updated Documentation in README.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-06-12 20:14:11 +05:30
8bf29fe17c merge: Optimize the space complexity of the fibonacci algo (#899)
* docs: update js doc

* feat: add number type validation condition

* pref: Optimize space complexity

remove the Array from the algo and used two flag varible to calculate last two numbers & optimize the sapce complexity O(n) to O(1)

* test: add test case for invalid types
2022-02-22 16:20:46 +05:30
7560beb068 merge: Add tests and docs for the Longest Common Subsequence algorithm (#867)
* Refactors, adds tests and comments to longest common subsequence algorithm

* Refactor docs for longest common subsequence algorithm

* Add links to wikipedia and leetcode

* Fix styling

* Refactor variable naming and jsdoc
2021-12-08 17:20:23 +05:30
4e7a15694b merge: add test case and description (#842) 2021-11-22 22:23:48 +05:30
02a4cee5c2 merge: optamization,documantation,return Array[bool] => Array[primes only], test case (#841) 2021-11-20 17:15:36 +05:30
93e57b0de5 merge: Add FibonacciNumber.js test case and update the decription of function. (#840) 2021-11-20 16:21:25 +05:30
f379475723 merge: Add TribonacciNumber in dp (#839) 2021-11-20 09:43:27 +05:30
e4d69f8d9c chore: Merge pull request #776 from raghhavtaneja/raghhavtaneja-patch-1
Create RodCutting.js
2021-10-20 15:16:04 +05:30
67ec915d97 added throwing an error when array with <3 items is passed 2021-10-15 21:49:29 +05:30
41ddee7074 Added Maximum product of 3 numbers in an array 2021-10-14 21:10:34 +05:30
5210273104 resolved style issues in the code 2021-10-12 16:55:56 +05:30
0ae960c4ee added tests for rodCutting and made some changes 2021-10-12 11:06:21 +05:30
ed49e122a7 tried to fix tests 2021-10-06 15:34:08 +05:30
5a59d1efc0 changes made 2021-10-06 15:02:37 +05:30
3a8e336262 added documentation, js standard style and jest testing to kadane algorithm file. 2021-10-06 14:45:07 +05:30
1589263947 fixed some spellings 2021-10-05 12:49:23 +05:30
199d2637cc Update LongestPalindromicSubsequence.test.js 2021-10-04 17:39:26 +05:30
e0c5d494ae Added space after comma 2021-10-03 21:20:53 +05:30
63ceac0925 Added test cases for TrappingRainWater 2021-10-03 21:13:08 +05:30
db3caea70f Added test cases for LongestValidParentheses 2021-10-03 20:58:53 +05:30
acd670bb2e Added test cases for LongestPalindromicSubsequence 2021-10-03 20:38:23 +05:30
9cf1e55859 Added the tests for coinChangeMin function 2021-08-15 15:35:35 +05:30
fa1524498b Added 2 Base tests and 5 main tests for CoinChange Problem. Refactored the code and removed the Memoized approach as it was not necessary 2021-08-13 12:53:34 +05:30