Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd6b3e66

Browse files
authored
Update src/data_structures/segment_tree.md
1 parent14ba8cc commitd6b3e66

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)

[8]ページ先頭

©2009-2025 Movatter.jp