MCPcopy Create free account

hub / github.com/ShahjalalShohag/code-library / functions

Functions3,514 in github.com/ShahjalalShohag/code-library

↓ 1 callersFunctiondfs
Graph Theory/Number of Paths of Each Length in a Tree.cpp:76
↓ 1 callersFunctiondfs
Graph Theory/Articulation Points.cpp:8
↓ 1 callersFunctiondfs
Graph Theory/Edge Coloring Bipartite Graph.cpp:22
↓ 1 callersFunctiondfs
Graph Theory/Dominator Tree.cpp:19
↓ 1 callersFunctiondfs
Graph Theory/Euler Path Directed.cpp:16
↓ 1 callersFunctiondfs
Graph Theory/Prufer Code.cpp:16
↓ 1 callersFunctiondfs
if the edge is in a cycle
Graph Theory/Cactus Graph.cpp:15
↓ 1 callersFunctiondfs
Graph Theory/Topological Sorting.cpp:8
↓ 1 callersFunctiondfs
Graph Theory/Path Union.cpp:7
↓ 1 callersFunctiondfs
Graph Theory/LCA.cpp:8
↓ 1 callersFunctiondfs1
Graph Theory/Block Cut Tree.cpp:31
↓ 1 callersFunctiondfs1
Graph Theory/ST Numbering.cpp:20
↓ 1 callersFunctiondfs1
Graph Theory/Unique Min Cut.cpp:76
↓ 1 callersFunctiondfs1
G is the condensed graph
Graph Theory/Kuhns Algorithm.cpp:52
↓ 1 callersFunctiondfs2
Graph Theory/ST Numbering.cpp:35
↓ 1 callersFunctiondfs2
Graph Theory/Unique Min Cut.cpp:85
↓ 1 callersFunctiondfs2
Graph Theory/Kuhns Algorithm.cpp:59
↓ 1 callersFunctiondfs3
Graph Theory/Cactus Graph.cpp:64
↓ 1 callersFunctiondfs4
Graph Theory/Cactus Graph.cpp:81
↓ 1 callersFunctiondfs_hld
Data Structures/HLD.cpp:88
↓ 1 callersMethoddifferentiate
Math/Polynomial.cpp:228
↓ 1 callersFunctiondijkstra
Graph Theory/Min Cut in a Planar Graph.cpp:6
↓ 1 callersFunctiondijkstra
Graph Theory/Johnson's Algorithm.cpp:33
↓ 1 callersFunctiondijkstra
Graph Theory/Dijkstra on Segment Tree.cpp:37
↓ 1 callersFunctiondiscrete_log
baby step - giant step returns minimum integer x such that a^x = b (mod m) a and m are co-prime
Number Theory/Discrete Log.cpp:10
↓ 1 callersFunctiondiscrete_log_noncoprime
discrete log but a and m may not be co-prime
Number Theory/Discrete Log.cpp:50
↓ 1 callersFunctiondiscrete_root
returns any x such that x ^ k = a (mod p), p is a prime 0^0 = 1 mod p Complexity: O(p ^ (1 / 4))
Number Theory/Discrete Root Faster.cpp:75
↓ 1 callersFunctiondist
Geometry/Delaunay Triangulation.cpp:126
↓ 1 callersFunctiondist
Data Structures/LCA.cpp:30
↓ 1 callersFunctiondist
Graph Theory/Block Cut Tree.cpp:47
↓ 1 callersFunctiondist
Graph Theory/Manhattan MST.cpp:36
↓ 1 callersMethoddist
distance from point p to plane
Geometry/Geometry 3D.cpp:109
↓ 1 callersFunctiondist2
Geometry/Geometry 3D.cpp:37
↓ 1 callersMethoddist2
Geometry/Geometry 3D.cpp:176
↓ 1 callersFunctiondiv
divide by x^e - 1
Math/Polynomial Factorization.cpp:43
↓ 1 callersMethoddiv_xk
Math/Polynomial.cpp:212
↓ 1 callersMethoddiv_xk
Math/Subset Sum Problem.cpp:192
↓ 1 callersMethoddiv_xk
Math/Faulhaber Formula Fastest.cpp:189
↓ 1 callersMethoddiv_xk
Number Theory/Bell Number.cpp:212
↓ 1 callersFunctiondivide_by_2_ceil
Miscellaneous/Negative Base (Binary).cpp:136
↓ 1 callersFunctiondivide_by_2_floor
Miscellaneous/Negative Base (Binary).cpp:131
↓ 1 callersFunctiondivisor_gap
returns k s.t. fib(i * k) (for i >= 0) are the only fib numbers which are divisible by n
Number Theory/Pisano Period.cpp:168
↓ 1 callersMethoddot
Geometry/Point Location.cpp:23
↓ 1 callersMethoderase
erase from qL to qR indexes so all previous indexes from qR+1 to last will be left shifted qR-qL+1 times
Data Structures/Implicit Treap.cpp:225
↓ 1 callersFunctioneval
Math/Number of Solutions of A Equation MITM.cpp:36
↓ 1 callersFunctioneval
Number Theory/Number of Solutions to a Basic Linear Algebraic Equation with Variable Upper Bound Constraints.cpp:36
↓ 1 callersFunctionevaluate
Miscellaneous/Expression Parsing.cpp:60
↓ 1 callersFunctioneven
Strings/Number of Palindromes in Range.cpp:132
↓ 1 callersMethodexp
Math/Polynomial.cpp:276
↓ 1 callersMethodexp
Math/Subset Sum Problem.cpp:222
↓ 1 callersMethodexp
Math/Faulhaber Formula Fastest.cpp:253
↓ 1 callersMethodexp
Number Theory/Bell Number.cpp:250
↓ 1 callersMethodextend
poly c = poly a * poly b add a[i] = x and b[i] = y and it will return c[i] online!
Math/NTT Online.cpp:55
↓ 1 callersMethodextend
Strings/Palindromic Tree Persistent.cpp:31
↓ 1 callersMethodextend
Strings/Minimum Palindrome Factorization.cpp:33
↓ 1 callersMethodextend
Strings/Suffix Automaton Distinct Substring Queries in Range.cpp:69
↓ 1 callersMethodextend
Strings/Palindromic Tree.cpp:26
↓ 1 callersFunctionextended_euclid
ax + by = __gcd(a, b) returns __gcd(a, b)
Number Theory/Intersection of Arithmetic Progressions.cpp:8
↓ 1 callersFunctionextended_euclid
ax + by = __gcd(a, b) returns __gcd(a, b)
Number Theory/Smallest Nonnegative Integer x s.t. l <= ax % p <= r.cpp:9
↓ 1 callersFunctionextended_euclid
Number Theory/Linear Diophantine Equation with Two Variables.cpp:5
↓ 1 callersFunctionextended_euclid
Number Theory/Linear Diophantine Equation with N Variables.cpp:7
↓ 1 callersFunctionextended_euclid
given are a[i], b[i], p and q: sum(x[i] * a[i]) = p --- (i) sum(x[i] * b[i]) = q --- (ii) x[i]s can only be integers. does a solution exist? **
Number Theory/Linear Diophantine With N Unknowns and Two Equations.cpp:14
↓ 1 callersFunctionextended_euclid
ax + by = __gcd(a, b) returns __gcd(a, b)
Number Theory/CRT.cpp:7
↓ 1 callersFunctionextended_euclid
Number Theory/Discrete Log.cpp:32
↓ 1 callersFunctionextended_euclid
Number Theory/Linear Diophantine Equation Three Variables with Nonnegative Solutions.cpp:5
↓ 1 callersFunctionextended_euclid
Number Theory/Linear Congruence Equation.cpp:6
↓ 1 callersFunctionextended_euclid
Number Theory/Extended Euclid.cpp:5
↓ 1 callersFunctionextract
p(x) = \sum{a[i] * C(x, i)}, where C(x, i) = x * (x - 1) * ... * (x - i + 1) / i! given p(0), p(1), ..., p(n) of an n degree poly returns {a[0], a[1],
Math/Polynomial with Binomial Coefficients.cpp:127
↓ 1 callersFunctionf
returns the smallest non-negative integer x s.t l <= a * x mod p <= r IMPORTANT : 0 <= a < p, 0 <= l <= r < p, p is not necessarily prime Complexity:
Number Theory/Smallest Nonnegative Integer x s.t. l <= ax % p <= r.cpp:38
↓ 1 callersFunctionf
number of solutions to x^2 = 1 mod p^k
Number Theory/Number of Solutions to x^2 = 1 mod m.cpp:93
↓ 1 callersFunctionfactor
Number Theory/Prime Factorization Fastest.cpp:101
↓ 1 callersFunctionfactoradic_to_decimal
Number Theory/Factoradic Number System.cpp:17
↓ 1 callersFunctionfactorize
Number Theory/Number of Solutions to x^2 = 1 mod m.cpp:75
↓ 1 callersFunctionfactorize
Number Theory/Pollard Rho.cpp:75
↓ 1 callersMethodfactorize
Number Theory/Prime Basis.cpp:86
↓ 1 callersFunctionfaulhaber
sum{i=0}^{n-1} i^k = 1/(k+1) \sum{i=0}^{k} binom(k+1, i)B[i] n^{k + 1 - i} ans[i] = sum_{p = 0}^{t}{p^i} it assumes 0^0 = 1
Math/Faulhaber Formula Fastest.cpp:406
↓ 1 callersFunctionfib
Number Theory/Phi Field.cpp:76
↓ 1 callersFunctionfib
Number Theory/Fibonacci Number Faster.cpp:4
↓ 1 callersFunctionfind_all_solutions
returns the number of solutions where x is in the range[minx, maxx] and y is in the range[miny, maxy]
Number Theory/Linear Diophantine Equation with Two Variables.cpp:37
↓ 1 callersFunctionfind_any_solution
a*x+b*y=c. returns valid x and y if possible. all solutions are of the form (x0 + k * b / g, y0 - k * b / g)
Number Theory/Linear Diophantine Equation with Two Variables.cpp:18
↓ 1 callersFunctionfind_any_solution
a * x + b * y = c. returns valid x and y if possible.
Number Theory/Linear Diophantine Equation with N Variables.cpp:19
↓ 1 callersFunctionfind_cen
Data Structures/Centroid Decomposition Persistent.cpp:51
↓ 1 callersFunctionfind_cen
Data Structures/Binarizing a Tree.cpp:52
↓ 1 callersFunctionfind_cen
Data Structures/Centroid Decomposition.cpp:18
↓ 1 callersFunctionfind_cen
Graph Theory/Tree Orientation.cpp:18
↓ 1 callersFunctionfind_cen
Graph Theory/Number of Paths of Each Length in a Tree.cpp:68
↓ 1 callersMethodfind_occurrence
occurrences of s[p, ..., p + len - 1]
Strings/Suffix Array Isomorphic.cpp:183
↓ 1 callersFunctionfind_recurrence_relation
Math/Linear Recurrence With Polynomial Coefficients.cpp:52
↓ 1 callersMethodfind_root
root of the rep. tree containing this node
Data Structures/Link Cut Tree.cpp:132
↓ 1 callersFunctionfloor_sum
\sum_{i = 0}^{n - 1}{(a + d * i) / m}, O(log m)
Number Theory/Floor Sum of Arithmetic Progressions.cpp:9
↓ 1 callersFunctionfracBS
Miscellaneous/Fraction Binary Search.cpp:13
↓ 1 callersFunctionfunc
Number Theory/Fermats Theorem on Sum of Two Squares.cpp:29
↓ 1 callersFunctiong_prefix_sum
g(x) = x
Number Theory/Powerful Number Sieve.cpp:62
↓ 1 callersFunctiongcd
O(a.size() * b.size()) if gcd.size() - 1 = number of common roots between a and b
Math/Polynomial.cpp:506
↓ 1 callersFunctiongcd
Number Theory/Discrete Root Faster.cpp:33
↓ 1 callersFunctionge
Geometry/Point Location.cpp:12
↓ 1 callersFunctionget
Math/Polynomial Factorization.cpp:76
↓ 1 callersMethodget
Miscellaneous/Maximum of Sum of All Pair Distances of K nodes in a Tree.cpp:110
↓ 1 callersMethodget
Data Structures/Treap.cpp:77
↓ 1 callersMethodget
Data Structures/Square Root Decomposition With Reverse Update.cpp:22
← previousnext →901–1,000 of 3,514, ranked by callers