private void SegmentTreeRandomOperation() { var segmentTree = new LazySumSegmentTree(_array); for (int i = 0; i < _randomRangesCount; ++i) { Tuple<int, int> range = _randomRanges[i]; if (range.Item1 % 2 == 0) { segmentTree.SumQuery(range.Item1, range.Item2); } else { segmentTree.Update(range.Item1, range.Item2, 1); } } }
private void SegmentTreeSumQuery() { var segmentTree = new LazySumSegmentTree(_array); for (int i = 0; i < _randomRangesCount; ++i) { Tuple<int, int> range = _randomRanges[i]; segmentTree.SumQuery(range.Item1, range.Item2); } }