Data Structures and Algorithms in Java
Full version of library on github
Collection of algorithms and data structures in Java written by indy256
The following topics are covered:
- Trees: segment tree, Fenwick tree, k-d tree, R-tree, metric tree, quadtree, persistent tree, link/cut tree, binary heap, disjoint-sets, treap
- Graph algorithms: shortest paths, maximum flow, maximum matching, spanning tree, connectivity, biconnectivity, LCA
- String algorithms: suffix tree, suffix automata, suffix array, trie, Aho-Corasick algorithm, Knuth-Morris-Pratt algorithm, Z-function, hashing, parsing
- Sorting algorithms: quick-, merge-, heap-, bubble-, selection-, insertion-, counting-, radix-sorting; Kth order statistic
- Geometry algorithms: segments/lines/circles intersection, point in polygon query, convex hull, closest/furthest pair of points
- Combinatorics: permutations, combinations, arrangements, partitions
- Other: big numbers multiplication via fast Fourier transform, simplex algorithm
-
AhoCorasick Aho–Corasick algorithm is a string searching algorithm that locates elements of a finite set of strings (the "dictionary") within an input text. It matches all strings simultaneously. -
AhoCorasickSimple AhoCorasickSimple
The details to be added soon -
AllNearestSmallerValues Given an array of numbers, for each position in the array, search among the previous positions for the last position that contains a smaller value. -
AngleAreaOrientationSortRotationPerpendicular Angle, area, orientation, sort, rotation, perpendicular -
ArithmeticCoding Arithmetic coding is a common algorithm used in both lossless and lossy data compression algorithms. It is an entropy encoding technique, in which the frequently seen symbols are encoded with fewer bits than lesser seen symbols. -
Arrangements Enumeration of arrangements -
ArrayRotate Array rotation -
BellmanFord Shortest paths. Bellman–Ford algorithm in O(V∗E)O(V∗E). Negative cycle detection. -
BellmanFord2 The Bellman–Ford algorithm is an algorithm that computes shortest paths from a single source vertex to all of the other vertices in a weighted digraph. -
Biconnectivity Bridges, cut points, edge-biconnected components, condensation tree In graph theory, a biconnected graph is a connected and "nonseparable" graph, meaning that if any vertex were to be removed, the graph will remain connected. -
BinaryExponentiation Raising a to the power of b is expressed naively as multiplication of a taken b times: a^b=a⋅a⋅…⋅a Eg: 3^11 = 3 * (3 ^ 2) * (3 ^ 8) = 3 * (3 ^ 2) * (((3^2)^2)^2) -
BinaryHeap A binary heap is a heap data structure that takes the form of a binary tree. Binary heaps are a common way of implementing priority queues. -
BinaryHeapExtended BinaryHeapExtended
The details to be added soon -
BinarySearch Find the index of an element in a sorted array. -
BinarySearchTree A binary tree where the left sub tree elements are smaller than the root and the right subtree elements are greater than the root. -
BinomialCoefficients Find the binomial coefficients -
BronKerbosh Bron-Kerbosch algorithm for enumerating maximal cliques in O(3 ^ (V/3)). -
Bwt The Burrows–Wheeler transform rearranges a character string into runs of similar characters. This is useful for compression, since it tends to be easy to compress a string that has runs of repeated characters. Used in bzip2 -
Calc2 Simple calculation implementatin -
CentroidDecomposition CentroidDecomposition
The details to be added soon -
ChainingHashMap ChainingHashMap
The details to be added soon -
CircleOperations CircleOperations
The details to be added soon -
Closest2Points Closest2Points
The details to be added soon -
Coloring Coloring
The details to be added soon -
Combinations Combinations
The details to be added soon -
CombinatorialEnumerations CombinatorialEnumerations
The details to be added soon -
Complex Complex
The details to be added soon -
ContractionHierarchies ContractionHierarchies
The details to be added soon -
ConvexCut ConvexCut
The details to be added soon -
ConvexHull ConvexHull
The details to be added soon -
ConvexHullOptimization ConvexHullOptimization
The details to be added soon -
CoverTree CoverTree
The details to be added soon -
CoverTreeTest CoverTreeTest
The details to be added soon -
CycleDetection CycleDetection
The details to be added soon -
Delaunay Delaunay
The details to be added soon -
DelaunayVoronoi DelaunayVoronoi
The details to be added soon -
Determinant Determinant
The details to be added soon -
Determinant1 Determinant1
The details to be added soon -
DfsNoRecursion DfsNoRecursion
The details to be added soon -
Dijkstra Dijkstra
The details to be added soon -
DijkstraCustomHeap DijkstraCustomHeap
The details to be added soon -
DijkstraHeap DijkstraHeap
The details to be added soon -
DijkstraSegmentTree DijkstraSegmentTree
The details to be added soon -
DisjointSets DisjointSets
The details to be added soon -
DisjointSetsRank DisjointSetsRank
The details to be added soon -
DominoFill DominoFill
The details to be added soon -
DoublyLinkedList DoublyLinkedList
The details to be added soon -
Euclid Euclid
The details to be added soon -
EulerCycle EulerCycle
The details to be added soon -
ExpressionParserRecursiveDescent ExpressionParserRecursiveDescent
The details to be added soon -
ExpressionParserShuntingYard ExpressionParserShuntingYard
The details to be added soon -
FFT FFT
The details to be added soon -
Factorization Factorization
The details to be added soon -
FenwickTree FenwickTree
The details to be added soon -
FenwickTree2D FenwickTree2D
The details to be added soon -
FenwickTree3D FenwickTree3D
The details to be added soon -
FenwickTreeExtended FenwickTreeExtended
The details to be added soon -
FloydWarshall FloydWarshall
The details to be added soon -
ForceBasedGraphDrawer ForceBasedGraphDrawer
The details to be added soon -
Gauss Gauss
The details to be added soon -
GeneticAlgorithm GeneticAlgorithm
The details to be added soon -
Graph Graph
The details to be added soon -
GraphColoringGreedy GraphColoringGreedy
The details to be added soon -
GraphColoringGreedy2 GraphColoringGreedy2
The details to be added soon -
Hashing Hashing
The details to be added soon -
HeavyLight HeavyLight
The details to be added soon -
HeavyLight2 HeavyLight2
The details to be added soon -
HeavyLight2NoRecursion HeavyLight2NoRecursion
The details to be added soon -
HillClimbing HillClimbing
The details to be added soon -
Hungarian Hungarian
The details to be added soon -
IFFT IFFT
The details to be added soon -
Inversions Inversions
The details to be added soon -
KaratsubaMultiply KaratsubaMultiply
The details to be added soon -
KdTreePointQuery KdTreePointQuery
The details to be added soon -
KdTreeRectQuery KdTreeRectQuery
The details to be added soon -
Kmp Kmp
The details to be added soon -
KnightDistance KnightDistance
The details to be added soon -
Lca Lca
The details to be added soon -
LcaSchieberVishkin LcaSchieberVishkin
The details to be added soon -
LcaSparseTable LcaSparseTable
The details to be added soon -
LinKernighan LinKernighan
The details to be added soon -
LinKernighan2 LinKernighan2
The details to be added soon -
LineGeometry LineGeometry
The details to be added soon -
LinearEqaulity LinearEqaulity
The details to be added soon -
LinkCutTree LinkCutTree
The details to be added soon -
LinkCutTreeConnectivity LinkCutTreeConnectivity
The details to be added soon -
LinkCutTreeLca LinkCutTreeLca
The details to be added soon -
Lis Lis
The details to be added soon -
Lis2 Lis2
The details to be added soon -
LyndonDecomposition LyndonDecomposition
The details to be added soon -
Lzw Lzw
The details to be added soon -
Matrix Matrix
The details to be added soon -
MatrixChainMultiply MatrixChainMultiply
The details to be added soon -
MaxFlowDinic MaxFlowDinic
The details to be added soon -
MaxFlowEdmondsKarp MaxFlowEdmondsKarp
The details to be added soon -
MaxFlowFordFulkerson MaxFlowFordFulkerson
The details to be added soon -
MaxFlowFordFulkersonSimple MaxFlowFordFulkersonSimple
The details to be added soon -
MaxFlowPreflowN3 MaxFlowPreflowN3
The details to be added soon -
MaxFlowPreflowN4 MaxFlowPreflowN4
The details to be added soon -
MaxFlowRetreat MaxFlowRetreat
The details to be added soon -
MaxMatching MaxMatching
The details to be added soon -
MaxMatching2 MaxMatching2
The details to be added soon -
MaxMatchingEdmonds MaxMatchingEdmonds
The details to be added soon -
MaxMatchingHopcroftKarp MaxMatchingHopcroftKarp
The details to be added soon -
MaxMatchingRandomized MaxMatchingRandomized
The details to be added soon -
MaxPalindrome MaxPalindrome
The details to be added soon -
MaximumZeroSubmatrix MaximumZeroSubmatrix
The details to be added soon -
MeetInTheMiddle MeetInTheMiddle
The details to be added soon -
MergeableHeap MergeableHeap
The details to be added soon -
MetricTree MetricTree
The details to be added soon -
MinCostFlow MinCostFlow
The details to be added soon -
MinCostFlowBF MinCostFlowBF
The details to be added soon -
MinCostFlowDense MinCostFlowDense
The details to be added soon -
MinCostFlowSimple MinCostFlowSimple
The details to be added soon -
Mis Mis
The details to be added soon -
MisWeighted MisWeighted
The details to be added soon -
MonotonicApproximation MonotonicApproximation
The details to be added soon -
MosAlgorithm MosAlgorithm
The details to be added soon -
MosAlgorithm2 MosAlgorithm2
The details to be added soon -
NthElement NthElement
The details to be added soon -
Pair Pair
The details to be added soon -
PairLong PairLong
The details to be added soon -
Partition Partition
The details to be added soon -
Partitions Partitions
The details to be added soon -
Permutations Permutations
The details to be added soon -
PersistentTree PersistentTree
The details to be added soon -
PointClassification PointClassification
The details to be added soon -
PointInPolygon PointInPolygon
The details to be added soon -
PointLocation PointLocation
The details to be added soon -
PointLocationOffline PointLocationOffline
The details to be added soon -
PointLocationRtree PointLocationRtree
The details to be added soon -
PointToSegmentDistance PointToSegmentDistance
The details to be added soon -
PolygonCircleIntersection PolygonCircleIntersection
The details to be added soon -
PolygonsIntersection PolygonsIntersection
The details to be added soon -
Prim Prim
The details to be added soon -
PrimHeap PrimHeap
The details to be added soon -
PrimesAndDivisors PrimesAndDivisors
The details to be added soon -
QuadTree QuadTree
The details to be added soon -
QueueMin QueueMin
The details to be added soon -
Quicksort Quicksort
The details to be added soon -
RTree RTree
The details to be added soon -
RandomGraph RandomGraph
The details to be added soon -
RandomPermutation RandomPermutation
The details to be added soon -
RandomPolygon RandomPolygon
The details to be added soon -
Rational Rational
The details to be added soon -
RayIntersections RayIntersections
The details to be added soon -
RectangleUnion RectangleUnion
The details to be added soon -
RecursiveDescentParser RecursiveDescentParser
The details to be added soon -
RmqSparseTable RmqSparseTable
The details to be added soon -
SCCKosaraju SCCKosaraju
The details to be added soon -
SCCTarjan SCCTarjan
The details to be added soon -
SCCTarjanNoRecursion SCCTarjanNoRecursion
The details to be added soon -
SCCTest SCCTest
The details to be added soon -
SCCTransitiveClosure SCCTransitiveClosure
The details to be added soon -
Sat2 Sat2
The details to be added soon -
SegmentTree SegmentTree
The details to be added soon -
SegmentTree2 SegmentTree2
The details to be added soon -
SegmentTree2D SegmentTree2D
The details to be added soon -
SegmentTree3D SegmentTree3D
The details to be added soon -
SegmentTreeFast SegmentTreeFast
The details to be added soon -
SegmentTreeFast2 SegmentTreeFast2
The details to be added soon -
SegmentTreeIntervalAddMax SegmentTreeIntervalAddMax
The details to be added soon -
SegmentTreeIntervalAddMax2 SegmentTreeIntervalAddMax2
The details to be added soon -
SegmentTreeSimple SegmentTreeSimple
The details to be added soon -
SegmentTreeSumLowerBound SegmentTreeSumLowerBound
The details to be added soon -
SegmentsIntersection SegmentsIntersection
The details to be added soon -
SegmentsIntersectionScanline SegmentsIntersectionScanline
The details to be added soon -
SegmentsIntersectionScanline2 SegmentsIntersectionScanline2
The details to be added soon -
SegmentsUnion SegmentsUnion
The details to be added soon -
SetPartitions SetPartitions
The details to be added soon -
ShortestHamiltonianCycle ShortestHamiltonianCycle
The details to be added soon -
ShortestHamiltonianCycle2 ShortestHamiltonianCycle2
The details to be added soon -
ShortestHamiltonianPath ShortestHamiltonianPath
The details to be added soon -
Simplex Simplex
The details to be added soon -
SimpsonIntegration SimpsonIntegration
The details to be added soon -
SimulatedAnnealing SimulatedAnnealing
The details to be added soon -
Sort Sort
The details to be added soon -
SteinerTree SteinerTree
The details to be added soon -
StringDistances StringDistances
The details to be added soon -
SuffixArray SuffixArray
The details to be added soon -
SuffixArray2 SuffixArray2
The details to be added soon -
SuffixAutomaton SuffixAutomaton
The details to be added soon -
SuffixTree SuffixTree
The details to be added soon -
TernarySearch TernarySearch
The details to be added soon -
TopologicalSort TopologicalSort
The details to be added soon -
TreapBST TreapBST
The details to be added soon -
TreapImplicitKey TreapImplicitKey
The details to be added soon -
TreapImplicitKey2 TreapImplicitKey2
The details to be added soon -
TreeCenters TreeCenters
The details to be added soon -
Trie Trie
The details to be added soon -
Vector2d Vector2d
The details to be added soon -
Vis Vis
The details to be added soon -
ZFunction ZFunction
The details to be added soon