{"id":13816094,"url":"https://github.com/indy256/codelibrary","last_synced_at":"2025-05-14T05:10:34.897Z","repository":{"id":1073739,"uuid":"1493359","full_name":"indy256/codelibrary","owner":"indy256","description":":gem:Collection of algorithms and data structures","archived":false,"fork":false,"pushed_at":"2025-01-19T20:05:02.000Z","size":3821,"stargazers_count":1979,"open_issues_count":98,"forks_count":522,"subscribers_count":93,"default_branch":"main","last_synced_at":"2025-04-11T00:02:39.465Z","etag":null,"topics":["algorithm","cpp","data-structures","java","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indy256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-03-17T20:38:29.000Z","updated_at":"2025-04-07T08:37:24.000Z","dependencies_parsed_at":"2024-04-11T20:49:15.846Z","dependency_job_id":"29021b0d-6e58-43ec-a376-506662d1dbe4","html_url":"https://github.com/indy256/codelibrary","commit_stats":{"total_commits":1452,"total_committers":12,"mean_commits":121.0,"dds":0.3147382920110193,"last_synced_commit":"3b3465b73b51b7cfbd8661a039cb294a830e44fc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indy256%2Fcodelibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indy256%2Fcodelibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indy256%2Fcodelibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indy256%2Fcodelibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indy256","download_url":"https://codeload.github.com/indy256/codelibrary/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076849,"owners_count":22010611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","cpp","data-structures","java","kotlin"],"created_at":"2024-08-04T05:00:34.079Z","updated_at":"2025-05-14T05:10:34.878Z","avatar_url":"https://github.com/indy256.png","language":"Java","readme":"[![GitHub stars](https://img.shields.io/github/stars/indy256/codelibrary.svg?style=flat\u0026label=star)](https://github.com/indy256/codelibrary/)\n[![Java CI](https://github.com/indy256/codelibrary/actions/workflows/java.yml/badge.svg)](https://github.com/indy256/codelibrary/actions/workflows/java.yml)\n[![C++ CI](https://github.com/indy256/codelibrary/actions/workflows/cpp.yml/badge.svg)](https://github.com/indy256/codelibrary/actions/workflows/cpp.yml)\n[![Rust CI](https://github.com/indy256/codelibrary/actions/workflows/rust.yml/badge.svg)](https://github.com/indy256/codelibrary/actions/workflows/rust.yml)\n[![License](https://img.shields.io/badge/license-UNLICENSE-green.svg)](https://github.com/indy256/codelibrary/blob/main/UNLICENSE)\n\n### Collection of algorithms and data structures in C++, Java, Kotlin, Python and Rust\n\n#### Data structures\n+ [x] Segment tree [**c++**](cpp/structures/segment_tree.h) [**java**](java/structures/SegmentTree.java) [**kotlin**](kotlin/SegmentTree.kt)\n+ [x] Segment tree without recursion [**c++**](cpp/structures/segment_tree_without_recursion.cpp) [**java**](java/structures/SegmentTreeWithoutRecursion.java)\n+ [x] 2d tree [**c++**](cpp/structures/tree_2d.cpp) [**java**](java/structures/Tree2d.java)\n+ [x] Fenwick tree [**c++**](cpp/structures/fenwick_tree.cpp) [**java**](java/structures/FenwickTree.java) [**kotlin**](kotlin/FenwickTree.kt) [**rust**](rust/structures/fenwick_tree.rs)\n+ [x] Fenwick tree with extended operations [**c++**](cpp/structures/fenwick_tree_interval.cpp) [**java**](java/structures/FenwickTreeExtended.java)\n+ [x] Persistent tree [**java**](java/structures/PersistentTree.java) [**kotlin**](kotlin/PersistentTree.kt) [**rust**](rust/structures/persistent_tree.rs)\n+ [x] Centroid decomposition [**c++**](cpp/structures/centroid_decomposition.cpp) [**java**](java/structures/CentroidDecomposition.java)\n+ [x] Heavy/light decomposition [**c++**](cpp/structures/heavy_light_decomposition.cpp) [**java**](java/structures/HeavyLight.java)\n+ [x] Link/cut tree [**c++**](cpp/structures/link_cut_tree.cpp) [**java**](java/structures/LinkCutTree.java)\n+ [x] Link/cut tree for connectivity query [**java**](java/structures/LinkCutTreeConnectivity.java)\n+ [x] Link/cut tree for LCA query [**java**](java/structures/LinkCutTreeLca.java)\n+ [x] Binary heap [**java**](java/structures/BinaryHeap.java)\n+ [x] Binary heap with change priority [**c++**](cpp/structures/binary_heap.cpp) [**java**](java/structures/BinaryHeapExtended.java)\n+ [x] Disjoint sets [**c++**](cpp/structures/disjoint_sets.cpp) [**java**](java/structures/DisjointSets.java) [**rust**](rust/structures/disjoint_sets.rs)\n+ [x] Treap [**c++**](cpp/structures/treap.h) [**java**](java/structures/Treap.java) [**kotlin**](kotlin/Treap.kt) [**rust**](rust/structures/treap.rs)\n+ [x] Treap with indexed key [**c++**](cpp/structures/treap_indexed.cpp) [**java**](java/structures/TreapIndexed.java)\n+ [x] k-d tree for point query [**c++**](cpp/structures/kd_tree.cpp) [**java**](java/structures/KdTreePointQuery.java)\n+ [x] k-d tree for rectangular query [**java**](java/structures/KdTreeRectQuery.java)\n+ [x] R-tree [**java**](java/structures/RTree.java)\n+ [x] Metric tree [**java**](java/structures/MetricTree.java)\n+ [x] Quadtree [**java**](java/structures/QuadTree.java)\n+ [x] Mergeable heap [**java**](java/structures/MergeableHeap.java) [**rust**](rust/structures/mergeable_heap.rs)\n+ [x] Queue with minimum [**c++**](cpp/structures/queue_min.cpp) [**java**](java/structures/QueueMin.java)\n+ [x] Sparse table [**c++**](cpp/structures/sparse-table.cpp) [**java**](java/structures/RmqSparseTable.java) [**java**](java/graphs/lca/LcaSparseTable.java)\n+ [x] Sparse segment tree [**c++**](cpp/structures/sparse-segment-tree.cpp)\n+ [x] Wavelet tree [**c++**](cpp/structures/wavelet_tree.cpp) [**java**](java/structures/WaveletTree.java)\n+ [x] Mo's algorithm [**java**](java/structures/MosAlgorithm.java)\n+ [x] Mo's algorithm with point updates [**c++**](cpp/structures/mos_with_updates.cpp)\n\n#### Graph algorithms\n+ [x] Shortest paths [**c++**](cpp/graphs/shortestpaths) [**java**](java/graphs/shortestpaths)\n+ [x] Maximum flow [**c++**](cpp/graphs/flows) [**java**](java/graphs/flows)\n+ [x] Maximum matching [**c++**](cpp/graphs/matchings) [**java**](java/graphs/matchings)\n+ [x] Spanning tree [**c++**](cpp/graphs/spanningtree) [**java**](java/graphs/spanningtree)\n+ [x] Connectivity [**c++**](cpp/graphs/dfs) [**java**](java/graphs/dfs)\n+ [x] Biconnectivity [**java**](java/graphs/dfs/Biconnectivity.java)\n+ [x] LCA Schieber-Vishkin algorithm [**c++**](cpp/graphs/lca/lca_rmq_schieber_vishkin.cpp) [**java**](java/graphs/lca/LcaSchieberVishkin.java)\n+ [x] LCA [**java**](java/graphs/lca)\n+ [ ] Planarity testing ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/28))\n+ [ ] Dynamic graph connectivity ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/29))\n+ [ ] Chu–Liu/Edmonds' algorithm ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/30))\n+ [ ] Minimum augmentation to strong connectivity ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/32))\n+ [ ] Minimum augmentation to biconnectivity ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/33))\n\n#### String algorithms\n+ [x] Knuth-Morris-Pratt algorithm [**c++**](cpp/strings/kmp.cpp) [**java**](java/strings/Kmp.java)\n+ [x] Aho-Corasick algorithm [**c++**](cpp/strings/aho-corasick.cpp) [**java**](java/strings/AhoCorasick.java)\n+ [x] Suffix array and lcp array. Radix sort algorithm in O(n*log(n)) [**c++**](cpp/strings/suffix-array.cpp) [**java**](java/strings/SuffixArray.java)\n+ [x] Suffix array. Algorithm DC3 in O(n) [**c++**](cpp/strings/suffix-array-dc3.cpp) [**java**](java/strings/SuffixArrayDC3.java)\n+ [x] Suffix array. Algorithm SA-IS in O(n) [**c++**](cpp/strings/suffix-array-sa-is.cpp)\n+ [x] Suffix automaton [**c++**](cpp/strings/suffix-automaton.cpp) [**java**](java/strings/SuffixAutomaton.java)\n+ [x] Suffix tree Ukkonen's algorithm [**c++**](cpp/strings/suffix_tree_ukkonen.cpp) [**java**](java/strings/SuffixTree.java)\n+ [x] Suffix tree Breslauer-Italiano algorithm [**c++**](cpp/strings/suffix_tree_breslauer_italiano.cpp)\n+ [x] Trie [**java**](java/strings/Trie.java)\n+ [x] Z-function [**c++**](cpp/strings/z-function.cpp) [**java**](java/strings/ZFunction.java)\n+ [x] Hashing [**c++**](cpp/strings/hashing.cpp) [**java**](java/strings/Hashing.java)\n+ [x] Parsing [**java**](java/parsing) [**c++**](cpp/parsing)\n+ [ ] Palindrome tree ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/34))\n+ [ ] Sorting strings in linear time ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/31))\n\n#### Sorting algorithms\n+ [x] Sorting algorithms [**c++**](cpp/sort/sort.cpp) [**java**](java/sort/Sort.java)\n+ [x] N-th element [**java**](java/sort/NthElement.java)\n\n#### Geometry algorithms\n+ [x] Segments intersection [**c++**](cpp/geometry/segments_intersection.cpp) [**java**](java/geometry/SegmentsIntersection.java)\n+ [x] Line operations [**java**](java/geometry/LineGeometry.java)\n+ [x] Circle operations [**java**](java/geometry/CircleOperations.java)\n+ [x] Convex hull [**c++**](cpp/geometry/convex_hull.cpp) [**java**](java/geometry/ConvexHull.java)\n+ [x] Point in polygon query [**c++**](cpp/geometry/point_in_polygon.cpp) [**java**](java/geometry/PointInPolygon.java)\n+ [x] Closest pair of points [**java**](java/geometry/Closest2Points.java)\n+ [x] Furthest pair of points [**c++**](cpp/geometry/diameter.cpp)\n+ [ ] Implement quaternion ([contribute a link or implementation](https://github.com/indy256/codelibrary/issues/35))\n\n#### Optimization\n+ [x] Simplex algorithm [**java**](java/optimization/Simplex.java)\n\n#### Numerical algorithms\n+ [x] Fast Fourier transform (FFT) [**c++**](cpp/numeric/fft.h) [**java**](java/numeric/FFT.java)\n+ [x] Long arithmetics [**c++**](cpp/numeric/bigint.cpp)\n+ [x] Fast subset convolution [**java**](java/numeric/SubsetConvolution.java)\n+ [x] Fast Walsh-Hadamar transform [**java**](java/numeric/WalshHadamarTransform.java)\n+ [x] Karatsuba multiplication [**java**](java/numeric/KaratsubaMultiply.java)\n+ [x] Newton interpolation [**java**](java/numeric/NewtonInterpolation.java)\n+ [x] Laguerre's root-finding algorithm [**c++**](cpp/numeric/polynom-roots.cpp)\n\n#### Number theory\n+ [x] Primes and divisors [**java**](java/numbertheory/PrimesAndDivisors.java) [**c++**](cpp/numbertheory/primes_and_divisors.cpp)\n+ [x] Factorization [**java**](java/numbertheory/Factorization.java) [**c++**](cpp/numbertheory/factorization.cpp)\n+ [x] Euclidean algorithm [**java**](java/numbertheory/Euclid.java) [**c++**](cpp/numbertheory/euclid.cpp)\n+ [x] Primitive root [**c++**](cpp/numbertheory/primitive_root.cpp)\n+ [x] Discrete logarithm [**c++**](cpp/numbertheory/discrete_log.cpp)\n+ [x] Discrete root [**c++**](cpp/numbertheory/discrete_root.cpp)\n+ [x] Multiplicative function [**java**](java/numbertheory/MultiplicativeFunction.java)\n+ [x] Rational numbers [**java**](java/numbertheory/Rational.java)\n+ [x] Polynom class [**c++**](cpp/numbertheory/polynom.h)\n+ [x] Linear recurrence and Berlekamp-Massey algorithm [**c++**](cpp/numbertheory/linear_recurrence.cpp)\n+ [x] Modular operations [**c++**](cpp/numbertheory/modint.h)\n\n#### Combinatorics\n+ [x] Permutations [**java**](java/combinatorics/Permutations.java)\n+ [x] Combinations [**java**](java/combinatorics/Combinations.java)\n+ [x] Arrangements [**java**](java/combinatorics/Arrangements.java)\n+ [x] Partitions [**java**](java/combinatorics/Partitions.java)\n+ [x] Set Partitions [**java**](java/combinatorics/SetPartitions.java)\n+ [x] Bracket sequences [**java**](java/combinatorics/BracketSequences.java)\n+ [x] Binomial coefficients [**java**](java/combinatorics/BinomialCoefficients.java)\n+ [x] Prufer code [**java**](java/combinatorics/PruferCode.java)\n\n#### Linear algebra\n+ [x] Gaussian elimination [**c++**](cpp/linearalgebra/gauss.cpp) [**java**](java/linearalgebra/Gauss.java) [**kotlin**](kotlin/Gauss.kt)\n+ [x] Determinant calculation [**java**](java/linearalgebra/Determinant.java)\n+ [x] Matrix operations [**c++**](cpp/linearalgebra/matrix.h) [**java**](java/linearalgebra/Matrix.java)\n","funding_links":[],"categories":["Github Libraries","Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findy256%2Fcodelibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findy256%2Fcodelibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findy256%2Fcodelibrary/lists"}