Segment Tree - Codeforces ProblemThe problem that a segment tree can solve is the following. We are ...

Please Visit: http://ift.tt/1ajReyV



Segment Tree - Codeforces

ProblemThe problem that a segment tree can solve is the following. We are given an array of values a[0], a[1], ..., a[N - 1]. Assume without loss of generality that N = 2n; we can generally pad the computations accordingly. Also, consider some associative binary function f. Examples of f include sum, min, max, or gcd (as in the Timus problem). Segment trees allow for each of the following two operations on O(logN) time:compute f(a[i], a[i + 1], ..., a[j]) for i ≤ j; and

update a[x] = v.

http://ift.tt/1pt4BYy

http://ift.tt/1pmP0rH



Segment Tree - Codeforces







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pt4Anu

via LifeLong Community

No comments:

Post a Comment