Creation of a Data Structures and Algorithms library that can be used in the browser or with Node.js
Algorithms tested with Mocha + Chai (test code available in test directory)
TypeScript version of the source code included (library and tests)
Project Structure
src/js/index.js file contains all the data structures and algorithms listed by chapter.
|_examples (how to use each data structure and algorithm, organized by chapter)
|_src
|___js (source code: JavaScript version)
|_____data-structures
|_______models (classes used by DS: Node, ValuePair, ...)
|_____others (other algorithms such as palindome checker, hanoi tower)
|___ts (source code: TypeScript version)
|_____data-structures
|_______models
|_____others
|_test (unit tests with Mocha and Chai for src)
|___js (tests for JavaScript code)
|___ts (tests for TypeScript code)
Installing and running the book examples With Node
Open terminal/cmd and change directory to this project folder: cd /Users/.../javascript-datastructures-algorithms (Linux/Max) or cd C:/.../javascript-datastructures-algorithms
run npm install to install all dependencies
To see the examples, run http-server html or npm run serve. Open your browser http:\\localhost:8080 to see the book examples
Or cd html/chapter01 and run each javascript file with node: node 02-Variables
Running the examples in the browser
Right click on the html file you would like to see the examples, right click and 'Open with Chrome (or any other browser)'
Or open the examples/index.html file to easily navigate through all examples:
请发表评论