- Notifications
You must be signed in to change notification settings - Fork0
🥞Data Structures and Algorithms explained and implemented in JavaScript + eBook
License
NotificationsYou must be signed in to change notification settings
pgupta56/dsa.js-data-structures-algorithms-javascript
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository covers the implementation of the most important algorithms and data structures.
This goes along withthese posts series that explain each implementation in details.
We are covering the following data structures.
- Arrays: Built-in in most languages so not implemented here.Code |Details.
- Linked Lists: each data node has a link to the next (and previous).Code |Details.
- Queue: data flows in a "first-in, first-out" (FIFO) manner.Code |Details.
- Stacks: data flows in a "last-in, first-out" (LIFO) manner.Code |Details.
- Trees: data nodes has zero or more adjacent nodes a.k.a. children. Each node can only have one parent node otherwise is a graph not a tree.Code |Details
- Binary Trees: same as tree but only can have two children at most.Details
- Binary Search Trees (BST): same as binary tree, but the nodes value keep this order
left < parent < rigth
.Code |Details - AVL Trees: Self-balanced BST to maximize look up time.Code |Details
- Red-Black Trees: Self-balanced BST more loose than AVL to maximize insertion speed.Code | Details
- Maps: key-value store.
- Graphs: datanodes that can have a connection oredge to zero or more adjacent nodes. Unlike trees, nodes can have multiple parents, loops.Code |Details
- Searching algorithms (WIP)
- Sorting algorithms (WIP)
Some notes while working on this project
Running one test without changing file
jest -t'#findNodeAndParent'
Running one test changing code
it.only('should return with an element and its parent',()=>{// ...});
Getting some (200k+) English words are useful for testing and benchmarking.
cat /usr/share/dict/words> benchmarks/dict.txt
Disabling ESLints
somthing(t)=>1// eslint-disable-line no-unused-vars// eslint-disable-next-line no-use-before-defineconstthing=newThing();/*eslint-disable *///suppress all warnings between commentsalert('foo');/*eslint-enable *//* eslint-disable no-alert, no-console */alert('foo');console.log('bar');/* eslint-enable no-alert */
About
🥞Data Structures and Algorithms explained and implemented in JavaScript + eBook
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Languages
- JavaScript99.9%
- Dockerfile0.1%