Awesome Open Source
Awesome Open Source

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/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)
|___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 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

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

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,061,746
Typescript (247,615
Algorithms (37,460
Graph (24,367
Tree (20,454
Book (20,238
Stack (16,098
Dictionaries (11,803
Structure (10,171
Data Structure (9,614
Edition (6,727
Set (5,941
Graph Algorithms (1,001
Sorting Algorithms (784
Linked List (663
Priority Queue (469
Binary Tree (350
Avl Tree (223
Dijkstra Algorithm (211
Quicksort (153
Deque (58
Javascript Algorithms (29