aboutsummaryrefslogtreecommitdiff
path: root/sd.go
diff options
context:
space:
mode:
authorAnthony Wang2022-03-29 07:51:11 -0500
committerAnthony Wang2022-03-29 07:51:11 -0500
commit71dbd4904da68565942d8ea4b193f46df2c37a2e (patch)
tree3a26222011a2dfe5a94a5cc0ae1ca130131837d5 /sd.go
parentd00b8abc5a9a1f5e1a287c04a84d4b135721963d (diff)
Change segmentTree member functions to uppercase
Diffstat (limited to 'sd.go')
-rw-r--r--sd.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/sd.go b/sd.go
index eb9e9fc..2f16bcb 100644
--- a/sd.go
+++ b/sd.go
@@ -40,7 +40,7 @@ func main() {
if err != nil {
panic(err)
}
- s.build(rows, 0, N-1, 1)
+ s.Build(rows, 0, N-1, 1)
rows.Close()
if *verbose {
@@ -58,7 +58,7 @@ func main() {
for {
// Choose a random card
x := rand.Intn(s.seg[1])
- w, i := s.query(x, 0, N-1, 1)
+ w, i := s.Query(x, 0, N-1, 1)
if *verbose {
fmt.Println(s.seg[1])
@@ -88,7 +88,7 @@ func main() {
}
// Update segment tree and database
- s.update(i, w, 0, N-1, 1)
+ s.Update(i, w, 0, N-1, 1)
_, err = db.Exec("UPDATE cards SET weight=? WHERE idx=?", w, i)
if err != nil {
panic(err)