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

Notifications You must be signed in to change notification settings

loiane/javascript-datastructures-algorithms

Repository files navigation

Learning JavaScript Data Structures and Algorithms

Build Status codecov devDependencies Status dependencies Status Greenkeeper badge

Source code ofLearning JavaScript Data Structures and Algorithmsbook, 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 intestdirectory)
  • TypeScriptversion of the source code included (library and tests)

Project Structure

src/js/index.jsfile 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

  • InstallNode
  • Open terminal/cmd and change directory to this project folder:cd /Users/.../javascript-datastructures-algorithms(Linux/Max) orcd C:/.../javascript-datastructures-algorithms
  • runnpm installto install all dependencies
  • To see the examples, runhttp-server htmlornpm run serve.Open your browserhttp:\\localhost:8080to see the book examples
  • Orcd html/chapter01and 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 theexamples/index.htmlfile to easily navigate through all examples:

  • Demo:https://javascript-ds-algorithms-book.firebaseapp

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 anIssueorPull Request