Skip to content
📚 collection of JavaScript and TypeScript data structures and algorithms for education purposes. Source code bundle of JavaScript algorithms and data structures book
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Sorting and Searching Algorithms Dec 26, 2017
examples [Graphs] May 1, 2018
src eslint update + fixed new js lint issues Mar 15, 2019
test tslint update + fixed new ts lint issues Mar 15, 2019
.firebaserc added firebase deploy for examples Oct 22, 2017
.gitignore [Algorithm Design and Techniques] Apr 9, 2018
.travis.yml updated travis May 1, 2018 added changelog file Oct 23, 2017 updated readme: chinese + portuguese links 3rd ed Mar 15, 2019
tsconfig.json chapter 07: [Dictionaries and Hashes] Oct 29, 2017
tslint.json es2015 setup Sep 17, 2017

Learning JavaScript Data Structures and Algorithms

Build Status codecov devDependencies Status dependencies Status Greenkeeper badge

Source code of Learning JavaScript Data Structures and Algorithms book, third edition.

List of available chapters:

Third Edition Updates

  • Algorithms using ES2015+ (ES6+)
  • New data structures and algorithms
  • All chapters rewritten and reviewed
  • Three (3) new chapters
  • 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 file contains all the data structures and algorithms listed by chapter.

|_examples (how to use each data structure and algorithm, organized by chapter)
|___js (source code: JavaScript version)
|_______models (classes used by DS: Node, ValuePair, ...)
|_____others (other algorithms such as palindome checker, hanoi tower)
|___ts (source code: TypeScript version)
|_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

  • Install Node
  • Open terminal/cmd and change directoty to this project folder: cd /Users/.../javascript-datastructures-algorithms (Linux/Max) or cd C:/.../javascript-datastructures-algorithms
  • run npm install to install all depencies
  • 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

Happy Coding!

Other editions

1st edition 2nd edition 3rd edition
1st edition 2nd edition 3rd edition
Book link Book link Book link

Book link - first edition:

Book link - second edition:

Book link - third edition:

Found an issue or have a question?

Please create an Issue or Pull Request

You can’t perform that action at this time.