|
/** Utils */ |
|
import Comparator from './utils/comparator/Comparator'; |
|
|
|
/** Data Structures */ |
|
import DisjointSetItem from './data-structures/disjoint-set/DisjointSetItem'; |
|
import DisjointSet from './data-structures/disjoint-set/DisjointSet'; |
|
import GraphVertex from './data-structures/graph/GraphVertex'; |
|
import GraphEdge from './data-structures/graph/GraphEdge'; |
|
import Graph from './data-structures/graph/Graph'; |
|
import HashTable from './data-structures/hash-table/HashTable'; |
|
import MinHeap from './data-structures/heap/MinHeap'; |
|
import LinkedListNode from './data-structures/linked-list/LinkedListNode'; |
|
import LinkedList from './data-structures/linked-list/LinkedList'; |
|
import PriorityQueue from './data-structures/priority-queue/PriorityQueue'; |
|
import Queue from './data-structures/queue/Queue'; |
|
import Stack from './data-structures/stack/Stack'; |
|
import AvlTree from './data-structures/tree/avl-tree/AvlTree'; |
|
import BinarySearchTreeNode from './data-structures/tree/binary-search-tree/BinarySearchTreeNode'; |
|
import BinarySearchTree from './data-structures/tree/binary-search-tree/BinarySearchTree'; |
|
import BinaryTreeNode from './data-structures/tree/BinaryTreeNode'; |
|
import TrieNode from './data-structures/trie/TrieNode'; |
|
import Trie from './data-structures/trie/Trie'; |
|
|
|
/** Algorithms */ |
|
// Graph |
|
import articulationPoints from './algorithms/graph/articulation-points/articulationPoints'; |
|
import bellmanFord from './algorithms/graph/bellman-ford/bellmanFord'; |
|
import breadthFirstSearch from './algorithms/graph/breadth-first-search/breadthFirstSearch'; |
|
import graphBridges from './algorithms/graph/bridges/graphBridges'; |
|
import detectDirectedCycle from './algorithms/graph/detect-cycle/detectDirectedCycle'; |
|
import detectUndirectedCycle from './algorithms/graph/detect-cycle/detectUndirectedCycle'; |
|
import detectUndirectedCycleUsingDisjointSet from './algorithms/graph/detect-cycle/detectUndirectedCycleUsingDisjointSet'; |
|
import dijkstra from './algorithms/graph/dijkstra/dijkstra'; |
|
import eulerianPath from './algorithms/graph/eulerian-path/eulerianPath'; |
|
import hamiltonianCycle from './algorithms/graph/hamiltonian-cycle/hamiltonianCycle'; |
|
import kruskal from './algorithms/graph/kruskal/kruskal'; |
|
import prim from './algorithms/graph/prim/prim'; |
|
import stronglyConnectedComponents from './algorithms/graph/strongly-connected-components/stronglyConnectedComponents'; |
|
import topologicalSort from './algorithms/graph/topological-sorting/topologicalSort'; |
|
import bfTravellingSalesman from './algorithms/graph/travelling-salesman/bfTravellingSalesman'; |
|
|
|
// Math |
|
import euclideanAlgorithm from './algorithms/math/euclidean-algorithm/euclideanAlgorithm'; |
|
import factorial from './algorithms/math/factorial/factorial'; |
|
import fibonnaci from './algorithms/math/fibonacci/fibonacci'; |
|
import integerPartition from './algorithms/math/integer-partition/integerPartition'; |
|
import leastCommonMultiple from './algorithms/math/least-common-multiple/leastCommonMultiple'; |
|
import trialDivision from './algorithms/math/primality-test/trialDivision'; |
|
|
|
// Search |
|
import binarySearch from './algorithms/search/binary-search/binarySearch'; |
|
|
|
// Sets |
|
import cartesianProduct from './algorithms/sets/cartesian-product/cartesianProduct'; |
|
import combineWithoutRepetitions from './algorithms/sets/combinations/combineWithoutRepetitions'; |
|
import combineWithRepetitions from './algorithms/sets/combinations/combineWithRepetitions'; |
|
import fisherYates from './algorithms/sets/fisher-yates/fisherYates'; |
|
import KnapsackItem from './algorithms/sets/knapsack-problem/KnapsackItem'; |
|
import Knapsack from './algorithms/sets/knapsack-problem/Knapsack'; |
|
import longestCommonSubsequnce from './algorithms/sets/longest-common-subsequnce/longestCommonSubsequnce'; |
|
import dpLongestIncreasingSubsequence from './algorithms/sets/longest-increasing-subsequence/dpLongestIncreasingSubsequence'; |
|
import bfMaximumSubarray from './algorithms/sets/maximum-subarray/bfMaximumSubarray'; |
|
import dpMaximumSubarray from './algorithms/sets/maximum-subarray/dpMaximumSubarray'; |
|
import permutateWithoutRepetitions from './algorithms/sets/permutations/permutateWithoutRepetitions'; |
|
import permutateWithRepetitions from './algorithms/sets/permutations/permutateWithRepetitions'; |
|
import powerSet from './algorithms/sets/power-set/powerSet'; |
|
import shortestCommonSupersequence from './algorithms/sets/shortest-common-supersequence/shortestCommonSupersequence'; |
|
|
|
// Sorting |
|
import BubbleSort from './algorithms/sorting/bubble-sort/BubbleSort'; |
|
import HeapSort from './algorithms/sorting/heap-sort/HeapSort'; |
|
import InsertionSort from './algorithms/sorting/insertion-sort/InsertionSort'; |
|
import MergeSort from './algorithms/sorting/merge-sort/MergeSort'; |
|
import QuickSort from './algorithms/sorting/quick-sort/QuickSort'; |
|
import SelectionSort from './algorithms/sorting/selection-sort/SelectionSort'; |
|
import ShellSort from './algorithms/sorting/shell-sort/ShellSort'; |
|
|
|
// String |
|
import hammingDistance from './algorithms/string/hamming-distance/hammingDistance'; |
|
import knuthMorrisPratt from './algorithms/string/knuth-morris-pratt/knuthMorrisPratt'; |
|
import levenshteinDistance from './algorithms/string/levenshtein-distance/levenshteinDistance'; |
|
import longestCommonSubstring from './algorithms/string/longest-common-substring/longestCommonSubstring'; |
|
import * as rabinKarp from './algorithms/string/rabin-karp/rabinKarp'; |
|
|
|
// Tree |
|
import * as treeBreadthFirstSearch from './algorithms/tree/breadth-first-search/breadthFirstSearch'; |
|
import depthFirstSearch from './algorithms/tree/depth-first-search/depthFirstSearch'; |
|
|
|
// Uncategorized |
|
import hanoiTower from './algorithms/uncategorized/hanoi-tower/hanoiTower'; |
|
import knightTour from './algorithms/uncategorized/knight-tour/knightTour'; |
|
import QueenPosition from './algorithms/uncategorized/n-queens/QueenPosition'; |
|
import nQueens from './algorithms/uncategorized/n-queens/nQueens'; |
|
|
|
/** Common Export */ |
|
export const JavaScriptUtils = { |
|
Comparator, |
|
}; |
|
|
|
export const JavaScriptDataStructures = { |
|
DisjointSetItem, |
|
DisjointSet, |
|
GraphVertex, |
|
GraphEdge, |
|
Graph, |
|
HashTable, |
|
MinHeap, |
|
LinkedListNode, |
|
LinkedList, |
|
PriorityQueue, |
|
Queue, |
|
Stack, |
|
AvlTree, |
|
BinarySearchTreeNode, |
|
BinarySearchTree, |
|
BinaryTreeNode, |
|
TrieNode, |
|
Trie, |
|
}; |
|
|
|
export const JavaScriptGraphAlgorithms = { |
|
articulationPoints, |
|
bellmanFord, |
|
breadthFirstSearch, |
|
graphBridges, |
|
detectDirectedCycle, |
|
detectUndirectedCycle, |
|
detectUndirectedCycleUsingDisjointSet, |
|
dijkstra, |
|
eulerianPath, |
|
hamiltonianCycle, |
|
kruskal, |
|
prim, |
|
stronglyConnectedComponents, |
|
topologicalSort, |
|
bfTravellingSalesman, |
|
}; |
|
|
|
export const JavaScriptMathAlgorithms = { |
|
euclideanAlgorithm, |
|
factorial, |
|
fibonnaci, |
|
integerPartition, |
|
leastCommonMultiple, |
|
trialDivision, |
|
}; |
|
|
|
export const JavaScriptSearchAlgorithms = { |
|
binarySearch, |
|
}; |
|
|
|
export const JavaScriptSetsAlgorithms = { |
|
cartesianProduct, |
|
combineWithoutRepetitions, |
|
combineWithRepetitions, |
|
fisherYates, |
|
KnapsackItem, |
|
Knapsack, |
|
longestCommonSubsequnce, |
|
dpLongestIncreasingSubsequence, |
|
bfMaximumSubarray, |
|
dpMaximumSubarray, |
|
permutateWithoutRepetitions, |
|
permutateWithRepetitions, |
|
powerSet, |
|
shortestCommonSupersequence, |
|
}; |
|
|
|
export const JavaScriptStringAlgorithms = { |
|
hammingDistance, |
|
knuthMorrisPratt, |
|
levenshteinDistance, |
|
longestCommonSubstring, |
|
rabinKarp, |
|
}; |
|
|
|
export const JavaScriptTreeAlgorithms = { |
|
breadthFirstSearch: treeBreadthFirstSearch, |
|
depthFirstSearch, |
|
}; |
|
|
|
export const JavaScriptSortingAlgorithms = { |
|
BubbleSort, |
|
HeapSort, |
|
InsertionSort, |
|
MergeSort, |
|
QuickSort, |
|
SelectionSort, |
|
ShellSort, |
|
}; |
|
|
|
export const JavaScriptUncategorizedAlgorithms = { |
|
hanoiTower, |
|
knightTour, |
|
QueenPosition, |
|
nQueens, |
|
}; |
|
|
|
const JavaScriptAlgorithms = { |
|
Struct: JavaScriptDataStructures, |
|
Graph: JavaScriptGraphAlgorithms, |
|
Math: JavaScriptMathAlgorithms, |
|
Search: JavaScriptSearchAlgorithms, |
|
Sets: JavaScriptSetsAlgorithms, |
|
Sorting: JavaScriptSortingAlgorithms, |
|
String: JavaScriptStringAlgorithms, |
|
Tree: JavaScriptTreeAlgorithms, |
|
Uncategorized: JavaScriptUncategorizedAlgorithms, |
|
}; |
|
|
|
export default JavaScriptAlgorithms; |
|
|