Algorithms-Javascript
Solutions of algorithm problems using Javascript. https://ignacio-chiazzo.github.io/Algorithms-Leetcode-Javascript/
Structure
The solutions are located under /LeetcodeProblems
. Each problem has a test file located under /LeetcodeProblemsTest
.
Run Tests
Unit tests: To run all the test run node Test.js
in the console. To run a specific problem in your console run node <problem_file_path>
(e.g. node LeetcodeProblems/Lowest_Common_Ancestor_of_a_Binary_Tree.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.
Leetcode Problems
Sorting Algorithms
Algoritmhs |
---|
Heap Sort |
Quick Sort |
Databases
UtilsClasses
Other languages provides built-in classes (e.g Linked List, Tree, etc). This module contains util classes to use in your problems.
Contributions
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