dsa4 min read
Modular Arithmetic: Fast Exponentiation and Inverse
Master modular arithmetic for competitive programming: binary exponentiation O(log n), modular inverse, and Chinese Remainder Theorem.
Read →
webcoderspeed.com
1276 articles
Master modular arithmetic for competitive programming: binary exponentiation O(log n), modular inverse, and Chinese Remainder Theorem.
Master GCD/LCM with Euclidean algorithm O(log n) and the Extended Euclidean for modular inverse computation.
Generate all primes up to n in O(n log log n) with the Sieve of Eratosthenes. Includes segmented sieve and prime factorization variants.
Master mathematical algorithms for DSA: primes, GCD, modular arithmetic, combinatorics, and fast exponentiation with 5-language implementations.
Master advanced graph algorithms: Kruskal and Prim MST, Tarjan SCC, articulation points, bridges, Floyd-Warshall all-pairs shortest path, and A* search.