Skip to content

Latest commit

History

History
63 lines (49 loc) 路 5.96 KB

deprecated-README.adoc

File metadata and controls

63 lines (49 loc) 路 5.96 KB

Data Structures and Algorithms in JavaScript

Build Status
npm version

This repository covers the implementation of the classical algorithms and data structures in JavaScript.

Book

You can check out the book that goes deeper into each topic and provide addtional 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.

cover

Data Structures

We are covering the following data structures.

46118890 ba721180 c1d6 11e8 82bc 6a671428b422

Linear Data Structures

  1. Arrays: Built-in in most languages so not implemented here. Post.

  2. Linked Lists: each data node has a link to the next (and previous). Code | Post.

  3. Queue: data flows in a "first-in, first-out" (FIFO) manner. Code | Post

  4. Stacks: data flows in a "last-in, first-out" (LIFO) manner. Code | Post.

Non-Linear Data Structures

  1. 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 | Post

    1. Binary Trees: same as tree but only can have two children at most. Code | Post

    2. Binary Search Trees (BST): same as binary tree, but the nodes value keep this order left < parent < rigth. Code] | Post

    3. AVL Trees: Self-balanced BST to maximize look up time. Code | Post

    4. Red-Black Trees: Self-balanced BST more loose than AVL to maximize insertion speed. Code

  2. Maps: key-value store.

    1. Hash Maps: implements map using a hash function. Code | Post

    2. Tree Maps: implement map using a self-balanced BST. Code

  3. 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 | Post

Algorithms

We cover the following algorithms and techniques.
  • Sorting algorithms

  • Greedy Algorithms

    • Fractional Knapsack Problem. Code

  • Divide and Conquer

    • Fibonacci Numbers. Code

  • Dynamic Programming

    • Fibonacci with memoization. Code

  • Backtracking algorithms

    • Word permutations. Code