package
Version:
v0.3.0
Opens a new window with list of versions in this module.
Published: Mar 10, 2025
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package sample provides a library of data structures/algorithms
for sampling from a stream of data.
type Reservoir struct {
Size int
}
Reservoir is a struct for performing reservoir sampling on a stream.
Push consumes a value to perform reservoir sampling.
Sample returns a copied slice of the obtained sample.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.