reservoir

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReservoirSampling

type ReservoirSampling[T any] struct {
	// contains filtered or unexported fields
}

ReservoirSampling selects k items from a stream of unknown size

func NewReservoirSampling

func NewReservoirSampling[T any](k int) *ReservoirSampling[T]

func (*ReservoirSampling[T]) Add

func (r *ReservoirSampling[T]) Add(v T)

Jump to

Keyboard shortcuts

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