Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SegmentTree ¶
type SegmentTree struct {
// contains filtered or unexported fields
}
func NewSegmentTree ¶
func NewSegmentTree(arr []int, mergeFunc func(int, int) int) *SegmentTree
func (*SegmentTree) Get ¶
func (st *SegmentTree) Get(i int) int
func (*SegmentTree) Len ¶
func (st *SegmentTree) Len() int
func (*SegmentTree) Query ¶
func (st *SegmentTree) Query(queryL, queryR int) int
返回区间[queryL, queryR]的值
func (*SegmentTree) Set ¶
func (st *SegmentTree) Set(index, val int)
在以rootIndex为根的线段树中更新index的值为val
func (*SegmentTree) String ¶
func (st *SegmentTree) String() string
Click to show internal directories.
Click to hide internal directories.