* 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>
* 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>
* fix: #758 optimised armstrongNumber code
* fix:#758 Average Median code optimised
* feat: TwoSum function added with test cases
* revert code
* Fix: #758 used ternary operator to make code more optimised
* Feat: TwoSum function created with test cases
* Feat: TwoSum function created with test cases
* Resolved comments and changes requests
* 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>
* test: remove ValidateUrl.test.js
The code was removed with ecac786d but the test was left here (and has been failing since then, obviously 🤣)
* test: remove conflicting test case
There is another test case that explicitly expects the `null` result when the input array only contains one element.
* Updated Documentation in README.md
---------
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added QuadraticRoots in the Math/QuadraticRoots
* Fixed math/QyadraticRoots var to let
* Added relevant links math/QyadraticRoots
* Added relevant links math/QyadraticRoots and fixed let - const
* Added the changes and @see notation in Math/QuadraticRoots.js
* Added the changes Math/QuadraticRoots.js and return an empty []
* Readd describe block, remove redundant comments
* Changed [1,1] to [1]
---------
Co-authored-by: Dibya <Dibya.DebayanDash@siriuscom.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
* added fibonacci using formula along with test cases
* updated the changes
* added jest's each in test cases
* added jest's each for testing
* returned inline value
* removed redundant comment
* hoisted the variables
* Use shorthand
* considered adding resource of the formula
---------
Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
* [feat] New algorithm
* [test] Add new test for ParityOutlier.js
* [fix] Reset indentation
* [fix] Reset indentation
* [fix] Style changes
* fix: improve code efficiency and a glitch
* test: adds a new possible test case
* fix: style fix
* fix: delete redundant comments and else statements
* [fix] style fix
* feat: Add check number case
* style: Fix formatting
* fix: Remove number check part
* feat: Create isPalindromeIntegerNumber
* test: Add minus number case
* Add an algorithm to find length and area of an arc of a circle
* Updated to follow Javascript Standard Style
* Update CircularArc.js
* Update CircularArc.js
* Add tests
* Followed Javascript standard style
* feat: Add mobius function implementation
* test: Add tests for mobius function
* fix: Code style fixes
* fix: Code style fixes
* fix: Store prime factors in a variable & add throw error
* fix: Fix unit tests for zero and negative numbers
* fix: Minor code style fixes
* Make `PerfectCube` more correct and readable
* Add negative and Infinity tests
* Fixed comment formatting
* Realized BigInt support is unnecessary
The algorithm would be exactly the same, so there's no added educational value
* Update PerfectCube.js
* Remove space
* Update PerfectCube.js
Now `isInt` is replaced by `isFinite`, because `isInt` is a redundant check
* Update PerfectCube.js
Remove dot
* Parity between `PerfectSquare` and `PerfectCube`
* Update PerfectSquare.test.js
Fixed the old copy-paste error that said "cube" instead of "square". And added `Infinity` test
* feat: Add pronic number implementation
* Add test to Math
* Minor fixes
* Minor style fixes
* refactor: Store square root in a variable
* Minor refactoring
* fix: Change pronic number check logic
Reduced time complexity from O(sqrt(n)) to O(1)
* Minor style fixes
* fix: Update pronic number check boolean equation
* refactor: Change pronic number check condition
* refactor: Add tests to Math
* Minor style fixes
* refactor: Change unit test logic
* Optimised the factorial function.
There was previously an unnecessary check for if the number was 0 or 1.
* Create WhileLoopFactorial.test.js
The test was not present previously.
* result *= num
* Update WhileLoopFactorial.test.js
* testFactorial function
* Space for formatting.
* should fix the formatting issues. I was having trouble with npx standard, so I just used the online verifier at https://standardjs.com/demo.html
* Auto-update DIRECTORY.md
* fix: some redundancy according to standard javascript library
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add Math function for representing the decimal expansion of a given fraction (decimal or any base from 2 to 10).
* Auto-update DIRECTORY.md
* DecimalExpansion Jest tests.
* chore: trigger update
* Auto-update DIRECTORY.md
* Auto-update DIRECTORY.md
* chore: trigger checks
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Rak Laptudirm <rak@laptudirm.com>
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
* FindMinIterator
Do the `standard` thing.
Rename `FindMin` to `FindMinIterator`
Rename to `FindMinIterator`
Pull `FindMin` from `master`
* Remove these separator comments.
Co-authored-by: RuSaG0 <mirzoev-ruslan-2000@mail.ru>
* refactor: used Boolean function for conversion
* feat: added one more function and test cases
* test: refactor test case & fixed var names
* chore: fixed test placeholder
* Create ArithmeticGeometricMean.js
* Finally added the test script for AGM
* Better doc, and corrected some formatting
* Fixed syntax typos
* Added more tests and made FP comparison more "loose"
* Patched bugs
* Fixed-0 bug
* Again, tried to fix minus zero
* Finally fixed all bugs (probably)
* Fixed style (probably)
* Fixed style
* Fixed all style