This repository covers the implementation of the classical algorithms and data structures in JavaScript.
You can clone the repo or install the code from NPM:
npm install dsa.js
and then you can import it into your programs or CLI
const { LinkedList, Queue, Stack } = require('dsa.js');
For a full list of all the exposed data structures and algorithms see.
You can check out the dsa.js book that goes deeper into each topic and provide additional illustrations and explanations.
- Algorithmic toolbox to avoid getting stuck while coding.
- Explains data structures similarities and differences.
- Algorithm analysis fundamentals (Big O notation, Time/Space complexity) and examples.
- Time/space complexity cheatsheet.
We are covering the following data structures.
-
Arrays: Built-in in most languages so not implemented here. Array Time complexity
-
Linked Lists: each data node has a link to the next (and previous). Code | Linked List Time Complexity
-
Queue: data flows in a "first-in, first-out" (FIFO) manner. Code | Queue Time Complexity
-
Stacks: data flows in a "last-in, first-out" (LIFO) manner. Code | Stack Time Complexity