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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy