--- id: PURQ title: "Point Update Range Query" author: Benjamin Qi prerequisites: description: Range queries for any associative operation over an array with updates using segment tree. frequency: 1 --- import { Problem } from "../models"; export const metadata = { problems: { sample: [ new Problem("YS", "Point Set Range Composite", "point_set_range_composite", "Intro", false, ["PURQ"], ""), ], general: [ new Problem("CSES", "Range Minimum Queries II", "1649", "Intro", false, ["PURQ"], ""), new Problem("Gold", "Springboards", "995", "Normal", false, ["PURQ"], "min segtree"), new Problem("Plat", "Nocross", "721", "Normal", false, ["PURQ"], "LIS variation"), new Problem("Plat", "Slingshot", "816", "Hard", false, ["PURQ"], ""), ] } };
A **segment tree** allows you to do point update and range query in $O(\log N)$ time each for any associative operation. ### Tutorials For gold, you only need to know the basics (ex. sum, min queries). You can skip more advanced applications such as **lazy propagation** for now. interactive simple implementation same implementation as above see slides after union-find ### Problems Can also try solving some of the BIT questions with segtree.