Skip to main content

2 docs tagged with "sqrt decomposition"

View all tags

Mo's Algorithm

Learn Mo's Algorithm for offline range queries with block decomposition, dry runs, complexity analysis, and implementations in C++, Java, Python, and JavaScript.

Sqrt Decomposition

Sqrt Decomposition is a technique that splits an array into blocks of size sqrt(n) to answer range queries and updates faster than brute force.