aboutsummaryrefslogtreecommitdiff
path: root/Data Structures
diff options
context:
space:
mode:
authorTa180m2019-11-29 15:20:48 -0600
committerTa180m2019-11-29 15:20:48 -0600
commita8f2f33be95151f7257baa4994ccdd5c0a2bf08c (patch)
tree5dcb963fe781a266d0d2de17e8eead077fec4f65 /Data Structures
parente82dc7de44b56a6c476cfbd88d11c3d7a7bd73da (diff)
updated segtree
Diffstat (limited to 'Data Structures')
-rw-r--r--Data Structures/segment_tree_v2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Data Structures/segment_tree_v2.cpp b/Data Structures/segment_tree_v2.cpp
index 5b3553a..546f6fd 100644
--- a/Data Structures/segment_tree_v2.cpp
+++ b/Data Structures/segment_tree_v2.cpp
@@ -51,7 +51,7 @@ public:
pull(n);
}
}
- void update(int a, int b, T v, int l = 0, int r = -1, int n = 1) {
+ void update_range(int a, int b, T v, int l = 0, int r = -1, int n = 1) {
if (r == -1) r = N - 1;
push(l, r, n);
if (l > b || r < a) return;
@@ -61,7 +61,7 @@ public:
}
else {
int m = (l + r) >> 1;
- update(a, b, v, l, m, n << 1), update(a, b, v, m + 1, r, n << 1 | 1);
+ update_range(a, b, v, l, m, n << 1), update_range(a, b, v, m + 1, r, n << 1 | 1);
pull(n);
}
}