SegmentTree represents the data structure of a segment tree with lazy propagation
| 15 | |
| 16 | // SegmentTree represents the data structure of a segment tree with lazy propagation |
| 17 | type SegmentTree struct { |
| 18 | Array []int // The original array |
| 19 | SegmentTree []int // Stores the sum of different ranges |
| 20 | LazyTree []int // Stores the values of lazy propagation |
| 21 | } |
| 22 | |
| 23 | // Propagate propagates the lazy updates to the child nodes |
| 24 | func (s *SegmentTree) Propagate(node int, leftNode int, rightNode int) { |
nothing calls this directly
no outgoing calls
no test coverage detected