Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ShahjalalShohag/code-library
/ functions
Functions
3,514 in github.com/ShahjalalShohag/code-library
⨍
Functions
3,514
◇
Types & classes
351
↓ 1 callers
Method
build
create a segment tree with only node i
Data Structures/Segment Tree Merging.cpp:27
↓ 1 callers
Method
build
Data Structures/Persistent Queue.cpp:11
↓ 1 callers
Method
build
Data Structures/Permutation Tree.cpp:26
↓ 1 callers
Method
build
Data Structures/Reachability Tree.cpp:26
↓ 1 callers
Method
build
Data Structures/Segment Tree Persistent Lazy.cpp:43
↓ 1 callers
Method
build
Data Structures/HLD.cpp:29
↓ 1 callers
Method
build
b = 0, e = 2^LOG - 1 O(LOG 2^LOG)
Data Structures/XOR Segment Tree.cpp:20
↓ 1 callers
Method
build
Data Structures/Persistent Array.cpp:11
↓ 1 callers
Method
build
Graph Theory/LCA in O(1).cpp:8
↓ 1 callers
Method
build
Graph Theory/Path Union.cpp:66
↓ 1 callers
Function
build_lps
returns the longest proper prefix array of pattern p where lps[i]=longest proper prefix which is also suffix of p[0...i]
Strings/KMP.cpp:8
↓ 1 callers
Function
buildtree
given specific nodes, construct a compressed directed tree with these vertices(if needed some other nodes included) returns the nodes of the tree node
Graph Theory/Virtual Tree.cpp:44
↓ 1 callers
Method
calc_occurrences
Strings/Minimum Palindrome Factorization.cpp:74
↓ 1 callers
Method
calc_occurrences
Strings/Palindromic Tree.cpp:62
↓ 1 callers
Function
calc_sz
Data Structures/Centroid Decomposition Persistent.cpp:41
↓ 1 callers
Function
calc_sz
Data Structures/Binarizing a Tree.cpp:43
↓ 1 callers
Function
calc_sz
Data Structures/Centroid Decomposition.cpp:9
↓ 1 callers
Function
calc_sz
Graph Theory/Tree Orientation.cpp:10
↓ 1 callers
Function
calc_sz
Graph Theory/Number of Paths of Each Length in a Tree.cpp:59
↓ 1 callers
Function
can
check if solution exists for some (p, q)
Number Theory/Linear Diophantine With N Unknowns and Two Equations.cpp:45
↓ 1 callers
Function
cartesian_tree
O(n) returns root of the tree has max heap property
Data Structures/Cartesian Tree.cpp:36
↓ 1 callers
Function
catalan
Math/NTT Online (D&C).cpp:118
↓ 1 callers
Function
check
Math/Finite Field Arithmetic Binary.cpp:73
↓ 1 callers
Function
check_power_of_2
Checks if x is a power of 2
Basics/Bitwise Operations.cpp:56
↓ 1 callers
Method
chirpz_even
Math/Polynomial.cpp:360
↓ 1 callers
Method
chirpz_even
Math/Faulhaber Formula Fastest.cpp:311
↓ 1 callers
Function
chromatic_number
O(n*2^n)
Graph Theory/Chromatic Number.cpp:6
↓ 1 callers
Function
circ
Geometry/Voronoi Diagram.cpp:36
↓ 1 callers
Function
circ
Geometry/Delaunay Triangulation.cpp:37
↓ 1 callers
Function
circle
Geometry/Delaunay Triangulation.cpp:135
↓ 1 callers
Function
circle_circle_intersection
Geometry/Geometry 2D.cpp:342
↓ 1 callers
Function
closest_on_l1
closest point from line l2 to line l1
Geometry/Geometry 3D.cpp:200
↓ 1 callers
Function
closest_pair
Geometry/Closest Pair of Points.cpp:10
↓ 1 callers
Function
cmp
Strings/Suffix Array Isomorphic.cpp:9
↓ 1 callers
Method
cmp
Data Structures/Segment Tree Persistent Lazy.cpp:82
↓ 1 callers
Function
cnt
Number Theory/Discrete Root Faster.cpp:10
↓ 1 callers
Method
combine
Miscellaneous/Maximum of Sum of All Pair Distances of K nodes in a Tree.cpp:96
↓ 1 callers
Method
combine
Data Structures/Treap.cpp:67
↓ 1 callers
Method
compute
Strings/Aho Corasick.cpp:33
↓ 1 callers
Function
compute_automaton
Strings/Prefix Automaton.cpp:27
↓ 1 callers
Function
congruence_equation
ax = b (mod m)
Number Theory/Linear Congruence Equation.cpp:24
↓ 1 callers
Function
constructMatrix
Math/FWHT in Any Base.cpp:31
↓ 1 callers
Function
convergents
ans[k] = [a[0]; a[1], ..., a[k]]
Number Theory/Continued Fractions.cpp:18
↓ 1 callers
Function
coprime
Number Theory/Maximum Coprime Product.cpp:15
↓ 1 callers
Function
count
number of solutions to ax + by + cz = n s.t. x, y, z >= 0 a, b, c >= 1, a, b and c are pairwise coprime O(log(max(a, b, c)));
Number Theory/Linear Diophantine Equation Three Variables with Nonnegative Solutions.cpp:36
↓ 1 callers
Method
count
Data Structures/Persistent UnionFind.cpp:89
↓ 1 callers
Method
count
count of numbers in [l, r] equal to k
Data Structures/Wavelet Tree.cpp:64
↓ 1 callers
Method
count
Graph Theory/Kirchoffs Theorem.cpp:62
↓ 1 callers
Function
count_except_xor_0
number of length n sequences with elements in [0, 2^k) such that no subset has xor 0 = number of length n independent subsets of elements in [0, 2^k)
Math/q Binomial.cpp:137
↓ 1 callers
Function
count_except_xor_1
number of length n sequences with elements in [0, 2^k) such that no subset has xor 1
Math/q Binomial.cpp:150
↓ 1 callers
Function
count_rank_r_except_xor_1
number of length n sequences with elements in [0, 2^k) such that no subset has xor 1 and its basis has size r not sure for general q, maybe also multi
Math/q Binomial.cpp:144
↓ 1 callers
Method
cross
Geometry/Onion Decomposition.cpp:9
↓ 1 callers
Method
cut
cut the left part of the line from point a to point b
Geometry/Half Plane Intersection Dynamic.cpp:91
↓ 1 callers
Method
cut
Data Structures/Link Cut Tree.cpp:114
↓ 1 callers
Method
cut_right
Data Structures/Top Tree.cpp:276
↓ 1 callers
Function
cycle3
degrees, precalc it m.sqrt(m)
Graph Theory/3 CYCLE and 4 CYCLE.cpp:14
↓ 1 callers
Function
cycle4
m.sqrt(m)
Graph Theory/3 CYCLE and 4 CYCLE.cpp:43
↓ 1 callers
Function
cyclic_convolution
ans[k] = sum(a[i] * b[j]) over 0 <= i < n and j - i = k
Math/Cyclic Convolution.cpp:53
↓ 1 callers
Function
de_bruijn
Strings/De Bruijn Sequence.cpp:9
↓ 1 callers
Function
decimal
https://en.wikipedia.org/wiki/Negative_base
Miscellaneous/Negative Base (Binary).cpp:6
↓ 1 callers
Function
decimal_to_factoradic
Number Theory/Factoradic Number System.cpp:9
↓ 1 callers
Function
decompose
Data Structures/Centroid Decomposition Persistent.cpp:75
↓ 1 callers
Function
decompose
Data Structures/Binarizing a Tree.cpp:75
↓ 1 callers
Function
decompose
Data Structures/Centroid Decomposition.cpp:25
↓ 1 callers
Function
decompose
Graph Theory/Number of Paths of Each Length in a Tree.cpp:94
↓ 1 callers
Function
decompose_mod_linear
Decomposes sequence S = { (a*k + b) % m | 0 <= k < n } into O(sqrt(m)) disjoint arithmetic progressions (non-wrapping). Preconditions: gcd(a, m) = 1
Number Theory/Sqrt Decomposition of Mod of Arithmetic Progression.cpp:56
↓ 1 callers
Function
del
Graph Theory/Boruvka's Algorithm.cpp:20
↓ 1 callers
Method
del
Data Structures/4D MO.cpp:19
↓ 1 callers
Function
delaunay
Geometry/Voronoi Diagram.cpp:96
↓ 1 callers
Function
delaunay
Geometry/Delaunay Triangulation.cpp:97
↓ 1 callers
Function
deleteNode
Deleting a node
Data Structures/BST.cpp:58
↓ 1 callers
Function
delim
Miscellaneous/Expression Parsing.cpp:4
↓ 1 callers
Function
det
Graph Theory/Kirchoffs Theorem.cpp:18
↓ 1 callers
Function
detZero
Math/Finite Field Arithmetic Binary.cpp:57
↓ 1 callers
Function
determinant
Graph Theory/Tuttes Theorem.cpp:7
↓ 1 callers
Function
dfs
Dynamic Programming Optimizations/Subset Sum in SQRT.cpp:50
↓ 1 callers
Function
dfs
Dynamic Programming Optimizations/Persistent Li Chao Tree.cpp:85
↓ 1 callers
Function
dfs
Math/Simplex Algorithm.cpp:15
↓ 1 callers
Function
dfs
Math/Basis Vector Reduced Row Echelon Form.cpp:52
↓ 1 callers
Function
dfs
Strings/Aho Corasick All Pair Occurrence Relation.cpp:111
↓ 1 callers
Function
dfs
Game Theory/Green Hackenbush.cpp:38
↓ 1 callers
Function
dfs
Game Theory/Blue Red Hackenbush.cpp:115
↓ 1 callers
Function
dfs
Number Theory/Sum of C(a(i), k) for each k from 1 to n.cpp:113
↓ 1 callers
Function
dfs
Data Structures/4D MO.cpp:58
↓ 1 callers
Function
dfs
Data Structures/MOs on tree.cpp:9
↓ 1 callers
Function
dfs
Data Structures/Dynamic Diameter Online.cpp:64
↓ 1 callers
Function
dfs
Data Structures/Cartesian Tree.cpp:23
↓ 1 callers
Function
dfs
Data Structures/Permutation Tree.cpp:163
↓ 1 callers
Function
dfs
Data Structures/Balanced Bracket Tree.cpp:8
↓ 1 callers
Function
dfs
Data Structures/Centroid Decomposition.cpp:37
↓ 1 callers
Function
dfs
Data Structures/Link Cut Tree.cpp:215
↓ 1 callers
Function
dfs
Data Structures/LCA.cpp:8
↓ 1 callers
Function
dfs
Graph Theory/Block Cut Tree.cpp:8
↓ 1 callers
Function
dfs
Graph Theory/Virtual Tree.cpp:8
↓ 1 callers
Function
dfs
Graph Theory/Tree Orientation.cpp:58
↓ 1 callers
Function
dfs
Graph Theory/Cycle Detection.cpp:10
↓ 1 callers
Function
dfs
Graph Theory/Inverse Graph.cpp:13
↓ 1 callers
Function
dfs
Graph Theory/Kirchoffs Theorem.cpp:97
↓ 1 callers
Function
dfs
number of edges
Graph Theory/Euler Path Undirected.cpp:18
↓ 1 callers
Function
dfs
Graph Theory/Path Intersection.cpp:8
← previous
next →
801–900 of 3,514, ranked by callers