2.1 KiB
2.1 KiB
id | title | author | prerequisites | description | |
---|---|---|---|---|---|
PURQ | 1D Point Update Range Query | Benjamin Qi |
|
Range queries for any associative operation over an array with updates, using segment tree. |
A segment tree allows you to do point update and range query in O(\log N)
time each for any associative operation. Historically, no gold problem has required the use of a segment tree in place of a binary indexed tree, but it's still good to know (and you might find it simpler).
Tutorials
- CPH 9.3, 28.1 (Segment Trees Revisited)
- Codeforces Tutorial
- CSAcademy Tutorial
- cp-algorithms
- Slides from CPC.3
Problems
Can try solving some of the BIT questions w/ segtree.
- CSES
- Range Minimum Queries II
- just min segtree
- Subarray Sum Queries
- Hotel Queries
- Range Minimum Queries II
- Normal SegTree
- USACO Gold Springboards
- can use segment tree with min query in place of the map mentioned in analysis
- USACO Old Gold Seating (check ...)
- USACO Old Gold Optimal Milking (check ...)
- USACO Old Gold Marathon (check ...)
- USACO Plat Balancing (check ...)
- USACO Plat Nocross
- POI Cards
- CSES Area of Rectangles
- use segment tree that keeps track of minimum and # of minimums
- USACO Gold Springboards