algorithms.js
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
;// orDataStructures;
- BST
- DisjointSetForest
- FenwickTree
- Graph
- HashTable
- Heap
- MaxHeap
- MinHeap
- LinkedList
- PriorityQueue
- Queue
- Set (HashSet)
- Stack
Geometry algorithms
;// orGeometry;
- BezierCurve
Graph algorithms
;// orGraph;
- breadthFirstSearch
- depthFirstSearch
- eulerPath
- topologicalSort
Shortest path
- bellmanFord
- bfsShortestPath
- dijkstra
- floydWarshall
- SPFA (Shortest Path Faster Algorithm)
Minimum spanning tree
- prim
- kruskal
Math algorithms
;// orMath;
- collatzConjecture
- extendedEuclidean
- fastPower
- fibonacci
- fisherYates
- gcd (Greatest common divisor)
- greatestDifference
- lcm (Least common multiple)
- newtonSqrt
- nextPermutation
- powerSet
- reservoirSampling
- shannonEntropy
Search algorithms
;// orSearch;
- bfs (breadth-first search for binary trees)
- binarySearch
- dfs (depth-first search for binary trees)
- inOrder (default)
- postOrder
- preOrder
Sorting algorithms
;// orSorting;
- bubbleSort
- countingSort
- heapSort
- insertionSort
- quicksort
- radixSort
- selectionSort
- shellSort
- shortBubbleSort
String algorithms
;// orString;
- hamming
- huffman
- decode
- encode
- knuthMorrisPratt
- levenshtein
- longestCommonSubsequence
- longestCommonSubstring
- rabinKarp