Skip to content

Commit d6b3e66

Browse files
authored
Update src/data_structures/segment_tree.md
1 parent 14ba8cc commit d6b3e66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/data_structures/segment_tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ In order to simplify the code, this function always does two recursive calls, ev
193193
```{.cpp file=segment_tree_implementation_sum}
194194
int sum(int v, int tl, int tr, int l, int r) {
195195
if (tr < l || tl > r) return 0; // no overlap
196-
if (tl >= l && tr <= r) return t[v]; // complete overlap
196+
if (l <= tl && tr <= r) return t[v]; // nested segment
197197
198198
int tm = (tl + tr) / 2;
199199
// partial overlap

0 commit comments

Comments
 (0)