1531 Commits

Author SHA1 Message Date
19924251be merge: Add test cases to ArbitraryBase, DateToDay & DateDayDifference Algorithm (#929) 2022-03-16 17:10:31 +05:30
a545f76669 merge: Add test case of SquareRoot function (#926) 2022-03-15 20:39:34 +05:30
0924f1c8c9 merge: Improved abs function (#923)
* feat: added validation, test codes

* chore: remove useless words
2022-03-15 17:41:50 +05:30
80cea0884b merge: Add testcases of BinaryCountSetBits function (#922) 2022-03-15 14:39:18 +05:30
7f479b8ced merge: consistent list syntax in CONTRIBUTING.md (#921)
* feat: add style and run scripts on pre-commit hooks

* Update package-lock.json

* Update CONTRIBUTING.md

* Add period at the end of lines
2022-03-12 10:30:46 +05:30
da6c22704e merge: refactor isEven function (#920)
* refactor: formated docs and functions

* refactor: format all test codes
2022-03-11 22:16:02 +05:30
4f6fe1975c merge: resolve example mistake (#919) 2022-03-10 22:25:06 +05:30
5198af80a9 merge: Run "style" and "test" scripts automatically when committing new changes (#918)
* feat: add style and run scripts on pre-commit hooks

* Update package-lock.json
2022-03-09 20:41:14 +05:30
35ba618355 merge: Added replace method to Upper (#916)
* feat: added replace method

* resolve: fix algo
2022-03-05 14:40:39 +05:30
00f593662b merge: Add alternative implementation for InsertionSort and relative test. Add additional algorithm description (#915)
Co-authored-by: Andrea Tota <tota@qi4m.com>
2022-03-04 19:41:37 +05:30
98c46b4d9e merge: Improved IsOdd function (#914)
* 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
2022-03-04 16:34:33 +05:30
cc55dabb4b merge: Updated pull_request_template (#913) 2022-03-02 21:58:41 +05:30
6656ece534 merge: Improved Memoize function (#912)
* 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
2022-03-02 14:26:16 +05:30
eb748ae78d merge: Fixed wordOccurrence algorithm (#909)
* resolved: upgrade the algoritm

* docs: add js doc
2022-03-02 10:43:01 +05:30
378d4abebc merge: Upgraded hexToBinary function (#910)
* feat: used js object intead of switch

* pref: optimzed the algo with regex & replace method

* feat: add hex validation with test case

* feat: add type validation

* chore: fix grammar mistake

* docs: add binLookup comments
2022-03-02 09:40:07 +05:30
ab06131656 merge: Improved Pow function (#911)
* feat: add negative power option

* docs: add js doc for powOn function

* feat: add PowFaster with faster algorithm, complexity O(logN)

* chore: rename to exponent

* chore: rename fixed

* style: formated with standard
2022-03-02 09:06:40 +05:30
e8de031539 merge: Improved pangram algorithm using regular expressions (#906)
* feat: used regex instead of Set

* docs: add js doc

* docs: add comments of workable code

* style: format via standardJs

* docs: add details explanation of pangram regex

* docs: add example

* feat: add two implemetaion of

The first implementation with regex and second via HashSet & add the test code for both

* chore: add QNA format of **Pangram**

* style: format with standardJs

* resolve: removed 'Ans'
2022-02-28 10:59:09 +05:30
d466be977e merge: Upgrade checkAnagram function & Fixes (#902)
* pref: optimize the algo via reduce & replace method

* feat: add TypeError for invalid types

* test: upgrade test case for invalid types

* docs: add js doc

* test: modify the case-sensitive test case

* pref: Optimize algo & add case-insensitive mode

* style: format with standard style

* docs: fix the js doc

* docs: rename function name & add comments

* feat: add chackAnagramViaMap function

* test: add test case for checkAnagramViaMap func

* fix: remove **Via** from functions name

* style: fix alignment of js doc

* chore: grammar fix

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2022-02-25 21:56:30 +05:30
0178efd8df merge: Algorithm to calculate the Arithmetic Geometric Mean (#897)
* 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
2022-02-24 16:15:56 +05:30
be15d08b4a merge: replaced constructor function with es6 class syntax (#900)
* replaced constructor function with es6 class syntax

* formatted code with standard.js
2022-02-23 16:16:45 +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
743b3179f7 merge: Corrected JSdoc typo (#898)
The URL in the Wikipedia link had an extra "h" in the URI Scheme (the part that specifies the protocol, usually `https`). I removed the duplicate "h" and made it into a single "h", now the link works
2022-02-21 16:28:40 +05:30
dbc98d096b merge: Bubble Sort enhancements for nearly sorted or sorted array, added test cases and documentation (#895)
* BubbleSort enacements for nearly sorted or sorted array and added test cases

* BubbleSort enacements for nearly sorted or sorted array and added test cases

* Bubble sort requested changes solved

* standard js style issue fixed
2022-02-19 17:53:54 +05:30
041918d7b7 merge: Upgrade Lower function (#894)
* docs: update the js doc

* pref: Optimize algo via regex

ignore the useless traverse in best case via regex and String.prototype.replace

* test: add some new test cases

* fix: styled with standard

* refactor: remove useless variable
2022-02-19 17:08:55 +05:30
29a3ab73bc merge: Iterator and log methods added for linked lists (#891)
* iterator, log methods added in SL

* iterator, log methods added in DL

* test file added for DoublyLL

* format issue fix
2022-02-18 20:13:45 +05:30
68ca0ceeef merge: optimize the countVowels algo (#886)
* pref: optimize the count vowels algo

simplify the algo by using regex and String.prototype.match method, and modified the JS Doc

* fix: resolve all requests

* pref: optimize the algo by regex

ignore the useless traverse in best case by the help of regex and String.prototype.replace method

* test: add four new test cases

* Revert "test: add four new test cases"
This reverts commit 4609833da146beafe839682d7558edf9f64c96fc.

* style: fromat with standard js
2022-02-17 17:30:04 +05:30
9911410e70 merge: Implement Add Two Numbers (Linked List) (#888)
* Implement Add Two Numbers (Linked List)

* Implement Add Two Numbers (Linked List)

* Implement Add Two Numbers (Linked List)

Co-authored-by: Shakil Ahmmed <shakilahmmed@ShakilAhmmeds-MacBook-Pro.local>
2022-02-17 17:29:36 +05:30
c9701e8a4c merge: Improving the coding standard for AvLTree Data Structure (#882)
* 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>
2022-02-17 14:08:26 +05:30
6bd2ac682d merge: Decrease time period for marking an issue stale (#885)
* chore: mark stale after 7 days of inactivity

* Auto-update DIRECTORY.md

* chore: length info provided in comments

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-02-16 19:26:34 +05:30
833d05d8d0 merge: binarySearch (#884)
* required, optional param left-to-right approch in BS

* base case return early to avoid nested if block

* codes formated with standard.js
2022-02-16 14:24:32 +05:30
c496925d25 merge: rename SinglyLinkList to SinglyLinkedList (#881) 2022-02-14 13:49:10 +05:30
31b06c9abe merge: Let traverseLevel return early if node is null (#878) 2022-01-24 15:13:48 +05:30
7dd99c1c03 merge: chore(deps): bump node-fetch from 2.6.1 to 3.1.1 (#877)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 3.1.1.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v3.1.1)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-23 16:03:35 +05:30
49fa7d1a9b merge: improve median (#869)
* median

* [/pull/869] make fn pure

* [/pull/869/] pure averageMedian fn

* [/pull/869] formatter
2021-12-20 22:27:05 +05:30
0aa5094bfd merge: add alphanumerical sort (#872)
* alphanumerical sort

* [/pull/872] add description to alphanumerical sort

* [/pull/872] add description to localCompare fn

* [/pull/872] code formatter
2021-12-20 22:23:28 +05:30
ef832f6920 merge: add areaTriangleWithAllThreeSides method in Math/Area.js (#875) 2021-12-15 23:00:11 +05:30
3d2a48f798 merge: Improve Mean method (#874) 2021-12-15 22:58:28 +05:30
bbdb5cf38a merge: Binary Convert (#865)
* Binary Convert

* Update link

* add more test cases
2021-12-14 11:01:52 +05:30
f387ff327c chore: Remove duplicate DigitSum algorithm (#873)
* Auto-update DIRECTORY.md

* chore: remove duplicate algorithm

* Auto-update DIRECTORY.md

* chore: remove duplicate algorithm tests

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-12-11 13:40:11 +05:30
c30b897324 merge: count Vowels (#864) 2021-12-11 13:30:26 +05:30
4d55b40c9e merge: Absolute value (#866) 2021-12-11 13:29:19 +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
43515a646b merge: Add Upper (#862) 2021-12-06 21:26:14 +05:30
4c27e1534e merge: Add lower (#863) 2021-12-04 11:01:58 +05:30
62b151eb69 merge: Fixes: #860 (#861) 2021-12-02 16:24:47 +05:30
6fb649e53d merge: Add ValidateUrl in String (#856)
* Add ValidateUrl in String

* change regex

* Bug fix
2021-12-02 16:23:54 +05:30
961f21f97c merge: Add test case and enacements (#858) 2021-12-01 11:38:06 +05:30
c3b2bacf08 merge: fixes: #{} (#853)
* fixes: #{}

* fixes : ISSUE#795

* Fixed ISSUE:795

* Fixed : ISSUE:795

* Fixed ISSUE : 795

* Fixed ISSUE : 795
2021-11-30 18:10:20 +05:30
bf681d1a91 merge: alphaNumericPlaindrome optamization (#857) 2021-11-29 20:45:18 +05:30
6f1edd16f5 merge: Add test Case for Palindrome Recursive (#855)
* Add test Case for Palindrome Recursive

* Update Checks
2021-11-28 13:34:54 +05:30