* 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>
* feat: add mergeTwoSortedLinkedLIsts algorithms
* remove class and unnecessary function
change the function params and return value from Node to LinkedList.
* 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>
* 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>
* 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>
* fix error in SinglyLinkedList head method
* test: update check head test for SinglyLinkedList
* fix: code style error
* fix: remove extra semicolons
---------
Co-authored-by: Bekzod <bekzodisakov18@gmail.com>
* ref: KeyPriorityQueue in separate file #1298
* feat: add tests for KeyPriorityQueue #1298
* fix: _shiftDown refactored and corrected #1298
* fix: use KeyPriorityQueue in PrimMST #1298
* feat: add test for PrimMST #1298
* fix: format files #1298
* fix: minor coding style changes
* fix: use map for keys and priorities #1298
* 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>
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.
* 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>
* feat: improved memoize function
used Map instead of object & used the JSON.stringfy method for generate a valid string as a key
* docs: modified documentation
* style: format with standard
* docs: modified stringify doc
* refactor: remove two repetition implementation
* feat: added validation, test codes
* chore: remove useless words
* feat: added types for jest
* chore: added link box
* feat: added new validation test casses & methods
* style: formated with standard
* feat: added parse method & test cases
* docs: added js docs
* chore: added default import export
* feat: imporved algorithm via replace method
* test: added two test cases
* feat: added jest type for suggestions
* feat: added `reduceRight` & `trim` method
* chore: added helper variable
* feat: added new rotation option
* Revert "chore: added helper variable"
This reverts commit 489544da0a3d479910fbea020d3be3d0d10681bf.
* remove: yarn lock
* chore: fix grammer
* feat: used replace method & added test case
* feat: remove revert
* chore: added new line
* feat: updated the Queue array to linkedlist DS
* chore: fixed grammer
* resolve: removed capacity related codes, & updated test cases
* feat: added length dicrease code on dequeue
* Auto-update DIRECTORY.md
* fix: some redundancy according to standard javascript library
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Improving the coding standard for AvLTree Data Structure
* Test case creation for AVLTree
~ Created test cases for AVL Tree
~ Indentation fix for AVLTree.js
* Auto-update DIRECTORY.md
* Change in logic for data list
* Style fix based on standard.js
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Create find_relative_maximum_point_count.js
print number of relative maximum points in array
runs in O(n)
* rename file to match requested casing
* add inline comments and greater documentation
* fix wrong reference to algorithm explanation
* remove live code and fix function misnaming
* add multiple cases tests
* add last line as empty line
* git pull
* style changes
* move tests to test folder
* chore: fix spelling
* fix package-lock
* revert to old lock file
* chore: add line feed
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
* Create first_relative_max_point_in_array.js
go over randomly generated array and print first spike or maximum point index in it
runs in O(log(n))
* rename file to match requested casing
* add comments
I prefer SOLID standards so that's why didn't add them at first but due to the repository requirements was needed to be added
* remove template unrelated comments
* Update equals check to match JavaScript standards
* create file skafolding and adjust filename to reflect main function
* using newer node version
* add tests
* add last line as empty line
* style changes
* move algorithm tests to test folder
* revert to old package lock file
* chore: add ending line feed
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
* fixed some spellings
* Update Data-Structures/Linked-List/SinglyLinkList.js
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>