aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--segmenttree.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/segmenttree.go b/segmenttree.go
index edda5c0..066c1f1 100644
--- a/segmenttree.go
+++ b/segmenttree.go
@@ -10,7 +10,7 @@ type segmentTree struct {
}
// Build segment tree
-func (s segmentTree) Build(a *sql.Rows, l, r, n int) {
+func (s *segmentTree) Build(a *sql.Rows, l, r, n int) {
if l == r {
a.Next()
a.Scan(&s.seg[n])
@@ -23,7 +23,7 @@ func (s segmentTree) Build(a *sql.Rows, l, r, n int) {
}
// Update value at index x
-func (s segmentTree) Update(x, v, l, r, n int) {
+func (s *segmentTree) Update(x, v, l, r, n int) {
if l == r {
s.seg[n] = v
return
@@ -38,7 +38,7 @@ func (s segmentTree) Update(x, v, l, r, n int) {
}
// Find element with prefix sum v
-func (s segmentTree) Query(v, l, r, n int) (int, int) {
+func (s *segmentTree) Query(v, l, r, n int) (int, int) {
if l == r {
return s.seg[n], l
}