algo

package
v0.0.0-...-5204ef5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AVLNode

type AVLNode[K cmp.Ordered] struct {
	// contains filtered or unexported fields
}

Self balance tree

func NewAVLNode

func NewAVLNode[K cmp.Ordered](key K) *AVLNode[K]

func (*AVLNode[K]) Delete

func (n *AVLNode[K]) Delete(key K) *AVLNode[K]

func (*AVLNode[K]) Insert

func (n *AVLNode[K]) Insert(key K) *AVLNode[K]

func (*AVLNode[K]) Select

func (o *AVLNode[K]) Select(i int) K

type AggregationAlgo

type AggregationAlgo[V any, AGG any] interface {
	Insert(V)
	Evict()
	Query() AGG
}

func NewOrderedStatsTreeSW

func NewOrderedStatsTreeSW[V cmp.Ordered]() AggregationAlgo[V, V]

func NewRecalculate

func NewRecalculate[V any, AGG any](aggFunc func(AGG, V) AGG, initAgg AGG) AggregationAlgo[V, AGG]

func NewSubOnEvict

func NewSubOnEvict[V any, AGG any](
	aggFunc func(AGG, V) AGG,
	subFunc func(AGG, V) AGG,
	initAgg AGG,
) AggregationAlgo[V, AGG]

func NewTwoStack

func NewTwoStack[V any, AGG any](
	aggFunc func(AGG, V) AGG,
	combineFunc func(AGG, AGG) AGG,
	initAgg AGG,
) AggregationAlgo[V, AGG]

type OrderedStatsTreeSW

type OrderedStatsTreeSW[V cmp.Ordered] struct {
	// contains filtered or unexported fields
}

Sliding window using ordered statistical tree

func (*OrderedStatsTreeSW[V]) Evict

func (o *OrderedStatsTreeSW[V]) Evict()

func (*OrderedStatsTreeSW[V]) Insert

func (o *OrderedStatsTreeSW[V]) Insert(val V)

func (*OrderedStatsTreeSW[V]) Query

func (o *OrderedStatsTreeSW[V]) Query() V

Query the median value

type Recalculate

type Recalculate[V any, AGG any] struct {
	// contains filtered or unexported fields
}

func (*Recalculate[V, AGG]) Evict

func (r *Recalculate[V, AGG]) Evict()

func (*Recalculate[V, AGG]) Insert

func (r *Recalculate[V, AGG]) Insert(val V)

func (*Recalculate[V, AGG]) Query

func (r *Recalculate[V, AGG]) Query() AGG

type StackEntry

type StackEntry[V any, AGG any] struct {
	// contains filtered or unexported fields
}

type SubOnEvict

type SubOnEvict[V any, AGG any] struct {
	// contains filtered or unexported fields
}

func (*SubOnEvict[V, AGG]) Evict

func (s *SubOnEvict[V, AGG]) Evict()

func (*SubOnEvict[V, AGG]) Insert

func (s *SubOnEvict[V, AGG]) Insert(val V)

func (*SubOnEvict[V, AGG]) Query

func (s *SubOnEvict[V, AGG]) Query() AGG

type TwoStack

type TwoStack[V any, AGG any] struct {
	// contains filtered or unexported fields
}

func (*TwoStack[V, AGG]) Evict

func (t *TwoStack[V, AGG]) Evict()

func (*TwoStack[V, AGG]) Insert

func (t *TwoStack[V, AGG]) Insert(val V)

func (*TwoStack[V, AGG]) Query

func (t *TwoStack[V, AGG]) Query() AGG

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL