Range Queries
This post is just for revising range queries. Have highlighted the topics and problems. Might write solutions (my approach) for these problems as well for future reference.
to do : create collapsible for solutions + also to put the same in DP post
Table of Contents (segment tree)
Link: cp-algorithms - Segment tree
- Simplest form of a Segment Tree ✔️
- Structure of the Segment Tree ✔️
- Construction ✔️
- Sum queries ✔️
- Update queries ✔️
- Implementation ✔️
- Memory efficient implementation ✔️
- Advanced versions of Segment Trees
- More complex queries ✔️
- Saving the entire subarrays in each vertex ✔️
- Range updates (Lazy Propagation) ✔️
- Generalization to higher dimensions 📝
- Preserving the history of its values (Persistent Segment Tree)
- Implicit segment tree
Table of Contents (fenwick tree or BIT)
Link: cp-algorithms - Fenwick tree
- Description
- Overview ✔️
- Definition of g(i) ✔️
- Implementation
- Finding sum in one-dimensional array ✔️
- Finding minimum of [0,r] in one-dimensional array ✔️
- Finding sum in two-dimensional array ✔️
- One-based indexing approach ✔️
- Range operations
- Point Update and Range Query ✔️
- Range Update and Point Query 📝
- Range Updates and Range Queries 📝
CSES.fi problemSet (Range Queries)
- Range Sum Queries I ✔️
- Range Sum Queries I ✔️
- Range Minimum Queries I ✔️
- Range Sum Queries II ✔️
- Range Minimum Queries II ✔️
- Range Xor Queries ✔️
- Range Update Queries ✔️
- Forest Queries ✔️
- Hotel Queries ✔️
- List Removals ✔️
- Salary Queries
- Subarray Sum Queries
- Distinct Values Queries
- Forest Queries II
- Range Updates and Sums
- Polynomial Queries
- Range Queries and Copies
Powered by Jekyll