This is a living notebook, created to:
- Practice:
- JavaScript
- Algorithms & data structures
- Unit testing
- JS static type check (with
jsdoc
andtsc
) - Git
- Solve programming challenges.
- Compare the running time of different implementations.
- Contain general notes about the solutions (explanations, very simple complexity analysis, optimizations, references, etc.).
To solve a project, write your solution and add it to the array inside
<project>.repo.js
. This will include it in unit testing and execution time
measurements.
npm test # Run unit tests for all projects (or from current location)
npm test <path to test.js file> # Run unit tests for one project
npm run full-test # Run unit tests and linter
# Run execution time measurement for one project
node <path to time.js file>
# Example
node src/project-euler/001-multiples-of-3-or-5/mults-of-3-or-5.time.js
First make sure you have both the node.js
runtime and the npm
package
manager installed. You can install them using the official page or
nvm.
Then:
git clone https://github.com/JCPedroza/algorithms-and-data-structures-js.git
cd algorithms-and-data-structures-js
npm install
node --test # Verbose, human readable
node --test --test-reporter dot # Minimal verbosity
npm test # Npm script
You can include a path after any of the above to run unit tests for one specific project.
node <path to time.js file>
npx standard . # Run using npx
npm run lint-test # Run using npm script
npm run
Have a new interesting solution? Found a bug, mistake, typo, or similar? Pull requests are very welcome!