Concepts3
∑MathIntermediate
Stars and Bars
Stars and Bars counts the ways to distribute n identical items into k distinct bins using combinations.
#stars and bars#combinatorics#binomial coefficient+12
∑MathIntermediate
Sieve of Eratosthenes
The Sieve of Eratosthenes marks multiples of each prime to find all primes up to n in O(n log log n) time.
#sieve of eratosthenes#segmented sieve#linear sieve+11
∑MathIntermediate
GCD and Euclidean Algorithm
The greatest common divisor (gcd) of two integers is the largest integer that divides both without a remainder.
#gcd#euclidean algorithm#extended euclidean+12