algorithms

0.10.0 • Public • Published

algorithms.js

Build Status Coverage Status Dependency Status devDependency Status Inline docs

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
  • DisjointSetForest
  • FenwickTree
  • Graph
  • HashTable
  • Heap
  • MaxHeap
  • MinHeap
  • LinkedList
  • PriorityQueue
  • Queue
  • Set (HashSet)
  • Stack

Geometry algorithms

require('algorithms/geometry');
// or
require('algorithms').Geometry;
  • BezierCurve

Graph algorithms

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

Math algorithms

require('algorithms/math');
// or
require('algorithms').Math;
  • collatzConjecture
  • extendedEuclidean
  • fastPower
  • fibonacci
  • fisherYates
  • gcd (Greatest common divisor)
  • greatestDifference
  • lcm (Least common multiple)
  • newtonSqrt
  • nextPermutation
  • powerSet
  • reservoirSampling
  • 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)
  • postOrder
  • preOrder

Sorting algorithms

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

String algorithms

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

Package Sidebar

Install

npm i algorithms

Weekly Downloads

30

Version

0.10.0

License

MIT

Last publish

Collaborators

  • felipernb