dsa3 min read
Square Root Decomposition: Range Queries in O(sqrt n)
Build range query structures in O(sqrt n) per query with block decomposition. Simpler alternative to segment trees.
Read →
1575 articles
Build range query structures in O(sqrt n) per query with block decomposition. Simpler alternative to segment trees.
Solve systems of modular congruences with the Chinese Remainder Theorem. Fundamental for cryptography and competitive math.
Explore classic number sequences: Fibonacci, Lucas, Pell, tribonacci, with DP and matrix approaches.
Master bitwise operations for DSA: XOR tricks, Brian Kernighan bit counting, subset enumeration, and bitmask DP.
Solve linear recurrences like Fibonacci in O(log n) using matrix exponentiation. Essential for DP optimization on large n.