Differences From Artifact [b7ca5af5f1eab32a]:
- File
lib/dataStructure/segmentTree.cpp
- 2013-09-14 20:29:31 - part of checkin [94afd8e13c] on branch trunk - Segment tree with range update. (user: kinaba) [annotate]
To Artifact [fb4d697dde7b0758]:
- File
lib/dataStructure/segmentTree.cpp
- 2013-12-12 03:04:28 - part of checkin [4db7305442] on branch trunk - Simplify Repeat() example. (user: kinaba) [annotate]
27 static Node Concat(const Node& l, const Node& r) 27 static Node Concat(const Node& l, const Node& r)
28 { 28 {
29 Node c = {l.sum + r.sum}; 29 Node c = {l.sum + r.sum};
30 return c; 30 return c;
31 } 31 }
32 static Node Repeat(const Node& n, int k) 32 static Node Repeat(const Node& n, int k)
33 { 33 {
34 if(k==0) return Zero(); <
35 Node c = {n.sum * k}; 34 Node c = {n.sum * k};
36 return c; 35 return c;
37 } 36 }
38 37
39 bool lazy; 38 bool lazy;
40 }; 39 };
41 40