This repository covers the implementation of the classical algorithms and data structures in JavaScript.
We are covering the following data structures.
- Arrays: Built-in in most languages so not implemented here. 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: data nodes that can have a connection or edge to zero or more adjacent nodes. Unlike trees, nodes can have multiple parents, loops. Code | Details
We cover the following algorithms and techniques.
- Sorting algorithms
- Greedy Algorithms
- Divide and Conquer
- Dynamic Programming
- Backtracking algorithms
You can check out the book that goes deeper into each topic and provide addtional illustrations and explanations.