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
Function
manachers
Strings/Number of Palindromes in Range.cpp:6
↓ 1 callers
Function
matriod_intersection
returns the largest subset of elements that is independent for both matroids formed by the elements (colorful matroid and graphic matroid in this case
Miscellaneous/Matroid Intersection Color Graphic Matroid.cpp:192
↓ 1 callers
Function
matriod_intersection
returns the largest subset of elements that is independent for both matroids formed by the elements (colorful matroid and linear matroid in this case)
Miscellaneous/Matroid Intersection Color Linear Matroid.cpp:189
↓ 1 callers
Function
max_clique
Graph Theory/Maximum Clique.cpp:27
↓ 1 callers
Method
max_flow
Graph Theory/Dinics Algorithm.cpp:62
↓ 1 callers
Method
max_flow
Graph Theory/Unique Min Cut.cpp:62
↓ 1 callers
Method
max_flow
Graph Theory/Maximum Closure Problem.cpp:62
↓ 1 callers
Method
max_flow
Graph Theory/Gomory Hu Tree.cpp:62
↓ 1 callers
Method
max_flow
Graph Theory/Maximum Density Subgraph.cpp:63
↓ 1 callers
Method
maximum_matching
Strings/Aho Corasick All Pair Occurrence Relation.cpp:92
↓ 1 callers
Method
maximum_matching
Game Theory/Matching Game On A Graph.cpp:84
↓ 1 callers
Method
maximum_matching
Graph Theory/Randomized Matching Weighted.cpp:49
↓ 1 callers
Method
maximum_matching
Graph Theory/Chinese Postman Problem.cpp:49
↓ 1 callers
Method
maximum_matching
Graph Theory/Randomized Matching Unweighted.cpp:40
↓ 1 callers
Method
maximum_matching
Graph Theory/Hungarian Algorithm.cpp:91
↓ 1 callers
Method
maximum_matching
Graph Theory/HopCroft Karp Algorithm.cpp:53
↓ 1 callers
Method
maximum_matching
Graph Theory/Kuhns Algorithm.cpp:34
↓ 1 callers
Method
maximum_matching
Graph Theory/Blossom Algorithm.cpp:84
↓ 1 callers
Method
meld
Data Structures/Persistent Meldable Heap.cpp:16
↓ 1 callers
Method
meld
Graph Theory/Eppsteins Algorithm.cpp:17
↓ 1 callers
Method
merge
connected components
Data Structures/Persistent UnionFind.cpp:90
↓ 1 callers
Method
merge
merge segment tree a and b
Data Structures/Segment Tree Merging.cpp:40
↓ 1 callers
Method
merge
Data Structures/DSU with Rollbacks.cpp:32
↓ 1 callers
Method
merge
Data Structures/Queue Undo Trick.cpp:32
↓ 1 callers
Method
merge
Data Structures/DSU Partially Persistent.cpp:10
↓ 1 callers
Method
merge
Graph Theory/Directed MST.cpp:15
↓ 1 callers
Method
merge
connected components
Graph Theory/Boruvka's Algorithm.cpp:52
↓ 1 callers
Method
merge
Graph Theory/Manhattan MST.cpp:21
↓ 1 callers
Method
merge
connected components
Graph Theory/Krushkal's MST.cpp:15
↓ 1 callers
Method
merge
Graph Theory/Gomory Hu Tree.cpp:120
↓ 1 callers
Function
merge_sort
Basics/Merge Sort.cpp:17
↓ 1 callers
Method
middle_product
1.0 * M(n)
Number Theory/Sum of nCi for a Fixed Large n.cpp:404
↓ 1 callers
Function
miller_rabin
O(it * (logn)^3), it = number of rounds performed
Number Theory/Number of Solutions to x^2 = 1 mod m.cpp:28
↓ 1 callers
Function
miller_rabin
O(it * (logn)^3), it = number of rounds performed (but faster in practice)
Number Theory/Miller Rabin.cpp:24
↓ 1 callers
Function
miller_rabin
O(it * (logn)^3), it = number of rounds performed
Number Theory/Pollard Rho.cpp:28
↓ 1 callers
Function
miller_rabin
O(it * (logn)^3), it = number of rounds performed
Number Theory/Pisano Period.cpp:38
↓ 1 callers
Function
minValueNode
Find the inorder successor
Data Structures/BST.cpp:47
↓ 1 callers
Function
min_plus_convolution
a[i + 1] - a[i] >= a[i] - a[i - 1] -> convex b[i + 1] - b[i] >= b[i] - b[i - 1] -> convex compute ans(i + j) = min(a(i) + b(j))
Miscellaneous/Min Plus Convolution (Convex and Convex).cpp:7
↓ 1 callers
Function
minxor
Graph Theory/Boruvka's Algorithm.cpp:32
↓ 1 callers
Function
mobius
Number Theory/Mobius Function.cpp:7
↓ 1 callers
Function
mobius_transform
mu(f(s))=\sum_{s' $ s}{(-1)^|s\s'| * f(s')} O(B * 2 ^ B)
Dynamic Programming Optimizations/SOS convolutions.cpp:24
↓ 1 callers
Function
modify
Graph Theory/Manhattan MST.cpp:33
↓ 1 callers
Method
mul
1.0 * M(n)
Number Theory/Sum of nCi for a Fixed Large n.cpp:392
↓ 1 callers
Function
mul_back
Dynamic Programming Optimizations/Number of Subsequences Having Product at least K.cpp:8
↓ 1 callers
Method
mul_basecase
Number Theory/Sum of nCi for a Fixed Large n.cpp:383
↓ 1 callers
Function
mul_front
Dynamic Programming Optimizations/Number of Subsequences Having Product at least K.cpp:17
↓ 1 callers
Method
mul_xk
modulo by x^k
Math/Subset Sum Problem.cpp:187
↓ 1 callers
Method
mul_xk
modulo by x^k
Number Theory/Bell Number.cpp:207
↓ 1 callers
Function
multiplicative_order
returns the minimum positive k s.t. a^ k = 1 modulo mod. On failure, returns -1 we just have to check the divisors of phi(mod) as candidates of k (Lag
Number Theory/Multiplicative Order.cpp:31
↓ 1 callers
Function
multiply
Math/q Binomial.cpp:37
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Math/Polynomial.cpp:53
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Math/Subset Sum Problem.cpp:53
↓ 1 callers
Function
multiply
Math/NTT Online.cpp:37
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Math/Faulhaber Formula Fastest.cpp:53
↓ 1 callers
Function
multiply
Math/Cyclic Convolution.cpp:36
↓ 1 callers
Function
multiply
Math/FFT.cpp:36
↓ 1 callers
Function
multiply
Math/NTT.cpp:37
↓ 1 callers
Function
multiply
a is of size n * n b is of size m * m max(n, m)^2 * log(max(n, m));
Math/NTT 2D.cpp:41
↓ 1 callers
Function
multiply
a[i + 1] - a[i] >= a[i] - a[i - 1] -> convex b[i + 1] - b[i] >= b[i] - b[i - 1] -> convex compute ans(i + j) = max(a(i) + b(j))
Math/Max Convolution between Convex Funtions.cpp:7
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Math/Lagrange Interpolation with Polynomial Extraction.cpp:53
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Math/Polynomial with Binomial Coefficients.cpp:53
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Math/NTT Online (D&C).cpp:53
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Number Theory/Bell Number.cpp:53
↓ 1 callers
Function
multiply
Number Theory/Stirling Number of the First Kind for Fixed n.cpp:36
↓ 1 callers
Function
multiply
Number Theory/Stirling Number of the Second Kind for Fixed n.cpp:36
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Number Theory/Stirling Number of the Second Kind for Fixed k.cpp:53
↓ 1 callers
Function
multiply
eq = 0: 4 FFTs in total eq = 1: 3 FFTs in total
Number Theory/Sum of C(a(i), k) for each k from 1 to n.cpp:53
↓ 1 callers
Function
multiply
Graph Theory/Number of Paths of Each Length in a Tree.cpp:39
↓ 1 callers
Function
multiply_brute
Math/NTT 2D.cpp:89
↓ 1 callers
Method
mulx_sq
Math/Polynomial.cpp:355
↓ 1 callers
Method
mulx_sq
Math/Faulhaber Formula Fastest.cpp:306
↓ 1 callers
Function
ncr
Math/NTT Online (D&C).cpp:114
↓ 1 callers
Function
ncr
Game Theory/Alpha Beta Pruning.cpp:16
↓ 1 callers
Function
ncr
Basics/Binomial Coefficients.cpp:18
↓ 1 callers
Function
ncr
C(n, r) modulo p^k O(p^k log n)
Number Theory/nCr Modulo Any Mod.cpp:61
↓ 1 callers
Function
ncr
Number Theory/Sum of C(a(i), k) for each k from 1 to n.cpp:136
↓ 1 callers
Method
ncr
Math/Polynomial Sum.cpp:48
↓ 1 callers
Method
ncr
Number Theory/Combinatorics Basics.cpp:47
↓ 1 callers
Method
ncr
Number Theory/Stirling Number of the Second Kind for Fixed k.cpp:261
↓ 1 callers
Method
ncr
Number Theory/Lucas Theorem.cpp:49
↓ 1 callers
Function
nearest_neighbor
Data Structures/KD Tree.cpp:69
↓ 1 callers
Function
newNode
Create a node
Data Structures/BST.cpp:11
↓ 1 callers
Function
odd
Strings/Number of Palindromes in Range.cpp:121
↓ 1 callers
Function
ok
Graph Theory/Minimum Mean Weight Cycle.cpp:24
↓ 1 callers
Method
ok
Graph Theory/3 SAT.cpp:88
↓ 1 callers
Method
ok
Graph Theory/2 SAT.cpp:67
↓ 1 callers
Function
orientation
Geometry/Half Plane Intersection Dynamic.cpp:37
↓ 1 callers
Function
oriented_angle_on_sphere
oriented angle between spherical segments ab and ac that is how much we rotate counterclockwise to get from ab to ac assume that the sphere is centere
Geometry/Geometry 3D.cpp:629
↓ 1 callers
Function
p_c
Number Theory/Dirichlet Convolution.cpp:70
↓ 1 callers
Function
path_intersection
returns the intersection of two paths (a,b) and (c,d) {0,0} for null path
Graph Theory/Path Intersection.cpp:68
↓ 1 callers
Function
perimeter
Geometry/Geometry 2D.cpp:568
↓ 1 callers
Function
perp
Geometry/Geometry 2D.cpp:44
↓ 1 callers
Function
phi
Number Theory/Power Tower.cpp:8
↓ 1 callers
Function
pisano_period
returns pisano period of n i.e. the period with which the sequence of Fibonacci numbers taken modulo n repeats
Number Theory/Pisano Period.cpp:151
↓ 1 callers
Function
pisano_period_prime
Number Theory/Pisano Period.cpp:120
↓ 1 callers
Function
point_location
For each query a pair (1,i) is returned if the point lies strictly inside the face number i, and a pair (0,i) is returned if the point lies on the edg
Geometry/Point Location.cpp:169
↓ 1 callers
Function
pollard_rho
returns O(n^(1/4))
Number Theory/Number of Solutions to x^2 = 1 mod m.cpp:56
↓ 1 callers
Function
pollard_rho
returns O(n^(1/4))
Number Theory/Pollard Rho.cpp:56
↓ 1 callers
Function
pollard_rho
returns O(n^(1/4))
Number Theory/Pisano Period.cpp:66
↓ 1 callers
Method
pop
Data Structures/Persistent Meldable Heap.cpp:32
← previous
next →
1,101–1,200 of 3,514, ranked by callers