Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Data Structures and Algorithms explained and implemented in JavaScript

License

NotificationsYou must be signed in to change notification settings

francisbissonnette/dsa.js-data-structures-algorithms-javascript

 
 

Repository files navigation

Build Statusnpm version

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

Usage

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 algorithmssee.

Book

You can check out thedsa.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.

dsajs algorithms javascript book

WARNING: Although you can find thebook text on this repo, there are some things that doesn't work well with Github's Asciidoc unfortunately. For instance rendering Graphviz diagrams, internal link references, including referenced chunks of code within text and some so on. For better reading experience and nicer presentation you can get thePDF format here.

Data Structures

We are covering the following data structures.

Interactive Data Structures

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 (andprevious).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 agraph not a tree.Code|Post

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

    2. Binary Search Trees (BST): same as binary tree, but thenodes value keep this orderleft < 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 tomaximize 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: datanodes that can have a connection oredge tozero or more adjacent nodes. Unlike trees, nodes can have multipleparents, loops.Code|Post

Algorithms

  • 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

About

Data Structures and Algorithms explained and implemented in JavaScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript100.0%

[8]ページ先頭

©2009-2025 Movatter.jp