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

Appearance settings

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

zengcool/algorithms.js

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

299 Commits
299 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

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

  • JavaScript 99.5%
  • Makefile 0.5%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.