Skip to content

Atwood's Law applied to CS101 - Classic algorithms and data structures implemented in JavaScript

License

Notifications You must be signed in to change notification settings

cycold/algorithms.js

Repository files navigation

algorithms.js

Build StatusCoverage StatusDependency StatusdevDependency StatusInline docsnpm

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');// orrequire('algorithms').DataStructures;
  • BST
  • DisjointSetForest
  • FenwickTree
  • Graph
  • HashTable
  • Heap
  • MaxHeap
  • MinHeap
  • LinkedList
  • PriorityQueue
  • Queue
  • Set (HashSet)
  • Stack

Geometry algorithms

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

Graph algorithms

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

Search algorithms

require('algorithms/search');// orrequire('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');// orrequire('algorithms').Sorting;
  • bubbleSort
  • countingSort
  • heapSort
  • insertionSort
  • quicksort
  • radixSort
  • selectionSort
  • shellSort
  • shortBubbleSort

String algorithms

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

Contributing

This project uses Google JavaScript Style Guide which can be a bit strict, but is really helpful in order to have more readable and less error-prone code

About

Atwood's Law applied to CS101 - Classic algorithms and data structures implemented in JavaScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript99.7%
  • Makefile0.3%