FenwickTree represents the data structure of the Fenwick Tree
| 9 | |
| 10 | // FenwickTree represents the data structure of the Fenwick Tree |
| 11 | type 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 |
nothing calls this directly
no outgoing calls
no test coverage detected