1736 Commits

Author SHA1 Message Date
53b1f667ee Project Euler 021 (#1347)
* feat: Project Euler Problem 21

* test: Project Euler 21

* fix: test description in Project Euler 21
2023-08-12 19:48:14 +05:30
ecac786da7 Remove URL validation (#1335)
* Update ValidateUrl.js

Used JS URL API to check if URL is valid. If valid it will return the url else false;

* Update ValidateUrl.js

Fixed for #1183

* Update ValidateUrl.js

fixed code style test.
Fixed for #1183

* Delete ValidateUrl.js

Fixes: #1183
2023-07-14 18:39:12 +05:30
6debd5c1a2 chore: 🤖 remove extra lines (#1330)
I ran the command yarn style and that got failed, so I fixed that
2023-06-17 01:49:21 +05:30
1666c3a0be fix error in SinglyLinkedList head method (#1322)
* 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>
2023-05-15 13:35:09 +05:30
331a4d26cf feat: Ciphers/MorseCode Algorithm (#1315)
* [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: New algorithm

* fix: fixed custom code symbols

* test: add test for MorseCode

* test: add case with custom code symbols

* delete files from main branch

* fix: style fix

* fix: style fix

* fix: delete unnecessary quotes
2023-05-01 11:47:47 +05:30
e6df6ebad6 New Algorithm: Parity Outlier (#1314)
* [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
2023-05-01 11:46:48 +05:30
84b01aeb61 fixed: to correct grammatical mistakes (#1307)
Corrected grammatical mistakes
2023-03-23 09:05:36 +05:30
1381ed0c17 feat: add dutchNationalFlagSort implementation (#1305)
* feat: add dutchNationalFlagSort implementation

* fix: add test, fit code style

* fix: add link to directory.md
2023-03-04 10:39:21 +05:30
327e18f450 Elementary cellular automata (#1302)
* feat: Added Elementary Cellular Automata Algorithm w/ explanation, examples, and further reading

* test: Added tests for Elementary Cellular Automata Algorithm

* chore: add Wikipedia link to Elementary Cellular Automata Algorithm

* Used | Bitwise OR and ^= (Bitwise XOR) operators in calculating next Elementary Generation over Addition + and Subtraction -=
2023-03-04 10:37:51 +05:30
fc06690672 fixes: #1280 and test: added tests for DFS algorithm (#1303)
* fix: fixed error in DepthFirstSearch algorithm and test: added tests for DepthFirstSearch algorithm.

* changed traverseDFS function parameters in DepthFirstSearch.js file
2023-03-02 00:03:24 +05:30
566d9103cd fix: refactor PrimMST and fix bug in PriorityQueue (#1300)
* 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
2023-02-23 20:05:45 +05:30
0c427580f1 Make ArbitraryBase Unicode-aware (#1299)
* Make ArbitraryBase Unicode-aware

https://mathiasbynens.be/notes/javascript-unicode#counting-symbols

* Fix performance bug and add Unicode test

* Add BigInt version and push output chars to array
2023-02-23 20:04:47 +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
5ce828b3fe feat: add maxConsecutiveOnes implementation (#1285) 2023-02-13 17:11:28 +05:30
55c18aef69 feat: add maxConsecutiveOnesIII implementation (#1286) 2023-02-13 17:10:20 +05:30
49bd1fd0c2 Adding to backtracking (#1289)
* adding generate-parenthses algorithm

* adding generateParenthses algorithm

* adding generate parentheses algorithm

* fixing comments according to the JDoc comments, cleaning code

* fixing comments
2023-02-13 17:09:31 +05:30
c40e4cf4d4 Refactored code to improve performance of some methods (#1284)
* refactored code to improve perfomance

* added 'check tail' test

* corrected styling and spelling mistake
2023-02-08 18:16:57 +05:30
c252df5d10 feat: add houseRobber implementation (#1282) 2023-02-07 22:21:00 +05:30
002b10a5aa docs: fix typos (#1283)
* docs: fix typos

* fix
2023-02-07 22:20:28 +05:30
8cd86b1eda chore(deps): bump json5 from 1.0.1 to 1.0.2 (#1274)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-08 19:17:15 +05:30
7ea7d7b8c6 docs: improve the issue forms (#1272) 2022-12-19 21:38:51 +05:30
cb4c40e95c docs: improve the contributing guidelines (#1271) 2022-12-18 15:50:06 +05:30
b36b45888e docs: fix CI and remove LGTM badges (#1269)
* Updated Documentation in README.md

* docs: fix CI and remove LGTM badges

LGTM is no longer a supported service and has been integrated with GitHub (which is now CodeQL).
We can create a CodeQL workflow and integrate it into the repository, however, that fits for another PR.

The shields badge API was updated, thus, causing an invalid badge: https://github.com/badges/shields/issues/8671

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-12-17 11:52:15 +05:30
65cceae0be algorithm: signum (#1266) 2022-12-08 18:57:42 +05:30
f954fb1ff7 Update README.md (#1268) 2022-12-08 18:56:10 +05:30
18a91573c3 Added a new Maths algorithm to determine if two non-null integers are "friendly numbers" (#1267) 2022-11-30 16:51:08 +05:30
d6be3a4e96 algorithm: Hexagonal number (#1265) 2022-11-30 16:50:38 +05:30
71d3d4470f tests: improve for GeneratePermutations (#1263) 2022-11-13 23:11:54 +05:30
9d4adbb0b3 docs: add new issue templates (#1206)
* Adding new issue template

* Adding bug issue template

* Adding feature request template

* Removing feature request template and adding comments

* Converting bug template to yaml

* Adding new feature request template

* CR changes part 1

* CR changes part 2

* CR changes part 3

* CR changes part 4

* CR changes part 5

* Removing specifications section
2022-11-06 10:33:11 -06:00
640abcf468 fix: exchanging wrong path that breaks pipeline (#1262) 2022-11-02 13:54:05 +01:00
00a97d5e1b algorithm: percentage of letter (#1261) 2022-11-01 09:15:02 +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
c39d6665ce algorithm: logarithmic square root (#1259)
* algorithm: add SquareRootLogarithmic algo and a test for it

* fix: fix spelling errors

* refactor: rename a variable "e" --> "edge"
2022-10-31 22:20:33 +05:30
35e1fe68d0 algorithm: add IntToBase algo and a test for it (#1258) 2022-10-31 22:19:14 +05:30
7fb121508d algorithm: ZFunction (#1239)
* algorithm: ZFunction

* made requested changes

* corrected spelling mistakes

* made requested changes
2022-10-31 22:12:06 +05:30
cc0700f122 conversion: liters to imperial gallons (#1256)
* Added liters to imperial gallons conversion

* Fixed documentation @see

* Pr suggestion
2022-10-31 22:11:29 +05:30
863185d2b4 algorithm class: pyramid (#1254)
* Added pyramid

* Removed * 1

* Change class name
2022-10-31 22:10:36 +05:30
014a38b2d4 algorithm: volume of sphere (#1249)
* Added sphere volume

* Fixed indentation

* Added PR Suggestions
2022-10-31 22:09:41 +05:30
b634aa581c conversion: liters to US gallons (#1255) 2022-10-31 22:07:48 +05:30
8cbaf2e299 convertion: ounce to kilogram (#1248)
* Added ounces to kilograms convertion

* Added PR suggestions

* changed to export default
2022-10-31 22:05:58 +05:30
7256e5313f algorithm class: circle (#1252) 2022-10-31 21:32:35 +05:30
f1ef64cc2d algorithm class: cone (#1253) 2022-10-31 21:31:20 +05:30
c5101e3e2b chore: add reverse to singly linked list (#1241)
* Fix: Reverse Singly Linked List

* Added reverse in SinglyLinkedList

* Added reverse in SinglyLinkedList

* Changes made
2022-10-30 14:46:56 +05:30
b88128dd97 algorithm: LCA by binary lifting (#1237)
* algorithm: LCA by binary lifting

* removed trailing spaces

* reduced code duplication by importing code from other file

* made requested changes
2022-10-30 14:42:40 +05:30
0fab492ceb fix: Project Euler P35 off-by-one error (#1238)
* fix: Project Euler P35 off-by-one error

* Updated Documentation in README.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-10-28 22:21:54 +05:30
5364a1c31b chore: check for invalid input to factorial (#1229) 2022-10-27 20:45:53 +02:00
d9d085faa7 algorithm: binary lifting (#1218)
* Algorithm: BinaryLifting

* Update BinaryLifting.js

* made the requested changes

* added more comments
2022-10-27 19:26:13 +05:30
945657a98f chore: use internal queue definition in BFS Shortest Path (#1230) 2022-10-27 18:45:33 +05:30
b24f1f61cb chore: use internal queue definition in BFS (#1228) 2022-10-27 11:41:39 +05:30
0529e19426 solution: Project Euler 35 (#1201)
* [CREATE] Problem 28 solution for Project Euler

* [UPDATE] Added an explanation for the formula used in the algorithm

* [CREATE] Added Problem 35 for Project-Euler

* [UPDATE] Little typo in the error string

* [UPDATE] Some algorithm changes

* [UPDATE] Fix test string

* [UPDATE] Change prime numbers generator to import a standard sieve
algorithm.

* [UPDATE] Change sieve algorithm implementation and now the solution
works well. Also added some optimizations
2022-10-24 17:30:33 +05:30