Solutions of algorithm problems using Javascript. https://ignacio-chiazzo.github.io/Algorithms-Leetcode-Javascript/
The solutions are located under /LeetcodeProblems
. Each problem has a test file located under /LeetcodeProblemsTest
.
Unit tests: To run all the test run node Test.js
in the console. To run a specific problem in your console run node Test.js <problem_file_path>
(e.g. node Test.js ./LeetcodeProblemsTests/Algorithms/easy/2Sum_Test.js
).
Linter: This repository uses es-lint
. To run all the tests you would need to install the packages by running npm install
followed by npx eslint LeetcodeProblems LeetcodeProblemsTests
which will run the eslint in all problems and tests. You can also use the flag --fix
which will automatically fix some of the errors.
Algoritmhs |
---|
Heap Sort |
Quick Sort |
Other languages provides built-in classes (e.g Linked List, Tree, etc). This module contains util classes to use in your problems.
I'd be pleased to accept contributions. I'd be happy to discuss problems and solutions over a Pull Request or an Issue.
Each problem should have:
- A description of the problem at the top of the file.
- A test file with some test cases. The test file must export a
test()
function which should run all the tests of the file. - An entry of the problem in the list of solutions within the README file.
PR Example: #39