Skip to content

Algorithms/data structure problems and solutions in Javascript

Notifications You must be signed in to change notification settings

yangfcm/algorithm-js

Repository files navigation

JS Algorithms & Data structures problems and solutions

Intro

Algorithms, Data Structure problems and solutions written in Javascript, including test cases.

Content

Algorithm

Data Structure

JS Specific

Sorting

Searching

How to run

  • Environment: NodeJS.
  • Under project directory.
  • Install packages
npm install
  • Test cases
npm run test
  • Test and watch code change
npm run watch
  • Test one case or cases under one directory
npm run test <file name or directory name>

Run in Docker

Under project directory:

  • Build image
docker build -t js-algo-docker .
  • Run test cases
docker run js-algo-docker

Run with Docker compose

This is useful for dev and tests.

Under project directory:

docker compose watch

To view the test results, you can either use Docker desktop or run

docker logs <container-name> -f

Any changes made locally will trigger the re-run of test cases.

Comment format

/**
 * @name
 * @description
 * @example
 * @param
 * @returns
 * @solution
 * @source
 */

Solutions in other languages:

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •