MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / FenwickTree

Struct FenwickTree

structure/fenwicktree/fenwicktree.go:11–15  ·  view source on GitHub ↗

FenwickTree represents the data structure of the Fenwick Tree

Source from the content-addressed store, hash-verified

9
10// FenwickTree represents the data structure of the Fenwick Tree
11type FenwickTree struct {
12 n int // n: Size of the input array.
13 array []int // array: the input array on which queries are made.
14 bit []int // bit: store the sum of ranges.
15}
16
17// NewFenwickTree creates a new Fenwick tree, initializes bit with
18// the values of the array. Note that the queries and updates should have

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected