* 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
* Bugfix AVLTree comparator
The original insertBalance function was doing raw value comparisons as opposed to using the tree's comparator. This is clearly unintentional, and would (ultimately) cause the structure to segfault when constructed with the stringData included in the updated test.
I've added the fix, scanned the rest of the code for similar issues, and added the appropriate test case which passes successfully with the fix. The jest code coverage increases slightly as well with the changes.
* 100% jest code coverage
Added a couple of extra elements to the original test tree, and then removed elements in an order such that all previously uncovered branches of code are now covered.
Also added an emptyTree structure to test some additional (trivial) base cases.
* standard style fix
missed this from my previous commit
* Iterative & in-place BFS
An iterative analog to the traditional recursive breadth-first-search algorithm for binary trees.
This in-place solution uses the pre-existing "traversal" array for both tracking the algorithm as well as storing the result.
Also tweaked old code by resetting the traversal array each time the tree is traversed (otherwise you're only allowed to traverse a tree once which doesn't seem correct even with a single traversal function).
* Update BreadthFirstTreeTraversal.js
got rid of unnecessary currentSize
added currentNode for clarity
* refactor out traversal member var
.. per earlier discussion w mods
also tweaked the tests to achieve 100% coverage
* Bugfix AVLTree comparator
The original insertBalance function was doing raw value comparisons as opposed to using the tree's comparator. This is clearly unintentional, and would (ultimately) cause the structure to segfault when constructed with the stringData included in the updated test.
I've added the fix, scanned the rest of the code for similar issues, and added the appropriate test case which passes successfully with the fix. The jest code coverage increases slightly as well with the changes.
* 100% jest code coverage
Added a couple of extra elements to the original test tree, and then removed elements in an order such that all previously uncovered branches of code are now covered.
Also added an emptyTree structure to test some additional (trivial) base cases.
* standard style fix
missed this from my previous commit
* Iterative & in-place BFS
An iterative analog to the traditional recursive breadth-first-search algorithm for binary trees.
This in-place solution uses the pre-existing "traversal" array for both tracking the algorithm as well as storing the result.
Also tweaked old code by resetting the traversal array each time the tree is traversed (otherwise you're only allowed to traverse a tree once which doesn't seem correct even with a single traversal function).
* Update BreadthFirstTreeTraversal.js
got rid of unnecessary currentSize
added currentNode for clarity
* Added Middle of linked-list implementation.
* Added Middle of LL function and tests
* Refactor: Added method in singly LL and its tests
* Refactor: Method name and inline test calls
* Use `!== null` instead of `!= null`
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
* 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
The original insertBalance function was doing raw value comparisons as opposed to using the tree's comparator. This is clearly unintentional, and would (ultimately) cause the structure to segfault when constructed with the stringData included in the updated test.
I've added the fix, scanned the rest of the code for similar issues, and added the appropriate test case which passes successfully with the fix. The jest code coverage increases slightly as well with the changes.
* 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
* Add test case to Interpolation Search Algorithm
* Updated Documentation in README.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add test case to Edit Distance Algorithm
* Updated Documentation in README.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add test case to Fibonacci Search Algorithm
* Updated Documentation in README.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add test case to jump search Algorithm
* Updated Documentation in README.md
* Remove commented code
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add test case to the Exponential Search Algorithm
* Updated Documentation in README.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>