algorithms.js

Traditional Computer Science algorithms and data structures implemented in JavaScript

View project on GitHub

algorithms.js

Build Status Coverage Status Dependency Status devDependency Status

Atwood's Law applied to CS101.

Classic algorithms and data structures implemented in JavaScript, you know... FOR SCIENCE.

Installing

npm install --save algorithms

Contents

Data Structures

require('algorithms/data_structures');
// or
require('algorithms').DataStructures;
  • BST
  • Graph
  • HashTable
  • Heap
    • MinHeap
    • MaxHeap
  • LinkedList
  • PriorityQueue
  • Queue
  • Stack
  • Set (HashSet)
  • DisjointSetForest

Graph algorithms

require('algorithms/graph');
// or
require('algorithms').Graph;
  • topologicalSort
  • eulerPath
  • depthFirstSearch
  • breadthFirstSearch
Shortest path
  • bfsShortestPath
  • dijkstra
  • SPFA (Shortest Path Faster Algorithm)
  • bellmanFord
  • floydWarshall
Minimum spanning tree
  • prim
  • kruskal

Math algorithms

require('algorithms/math');
// or
require('algorithms').Math;
  • fibonacci
  • fisherYates
  • gcd (Greatest common divisor)
  • extendedEuclidean
  • newtonSqrt
  • reservoirSampling
  • fastPower
  • nextPermutation
  • powerSet
  • shannonEntropy

Search algorithms

require('algorithms/search');
// or
require('algorithms').Search;
  • bfs (breadth-first search for binary trees)
  • binarySearch
  • dfs (depth-first search for binary trees)
    • inOrder (default)
    • preOrder
    • postOrder

Sorting algorithms

require('algorithms/sorting');
// or
require('algorithms').Sorting;
  • bubbleSort
  • countingSort
  • heapSort
  • quicksort
  • selectionSort
  • radixSort
  • insertionSort
  • shellSort

String algorithms

require('algorithms/string');
// or
require('algorithms').String;
  • levenshtein
  • rabinKarp
  • knuthMorrisPratt
  • huffman
    • encode
    • decode
  • hamming
  • longestCommonSubsequence
  • longestCommonSubstring
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy