Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryIndexedTree ¶
type BinaryIndexedTree struct {
// contains filtered or unexported fields
}
Binary Indexed Tree 树状数组
func NewBinaryIndexedTree ¶
func NewBinaryIndexedTree(list []int) *BinaryIndexedTree
NewBinaryIndexedTree 构造一个新的bit
func (*BinaryIndexedTree) PrefixSum ¶
func (b *BinaryIndexedTree) PrefixSum(idx int) int
Prefix return sum of [0:idx]
func (*BinaryIndexedTree) RangeSum ¶
func (b *BinaryIndexedTree) RangeSum(from, to int) int
RangeSum return sum of array[from:to]
func (*BinaryIndexedTree) Update ¶
func (b *BinaryIndexedTree) Update(idx, delta int)
Update add delta to array[idx]
Click to show internal directories.
Click to hide internal directories.