Documentation
¶
Overview ¶
Package alg provides generic algorithm utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectN ¶
CollectN drains up to limit items from iter into a slice. A limit of 0 means unlimited — all items are collected. Returns (nil, nil) when the iterator is already exhausted. Non-EOF errors are returned immediately with a nil slice.
func ForEachPair ¶
ForEachPair calls visit for every unique pair (i, j) where 0 <= i < j < n. The total number of calls is C(n, 2) = n*(n-1)/2. Does nothing when n < 2.
func TraverseTree ¶
TraverseTree performs an iterative pre-order DFS over a tree. children returns the children of a node; visit is called for each node with its depth (root depth is 0). An empty children slice terminates the branch.
Types ¶
type Iterator ¶
Iterator is a pull-based sequence of T values. Next returns (value, nil) for each item and (zero, io.EOF) when exhausted. Close releases any resources held by the iterator.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bloom provides a space-efficient probabilistic set membership filter.
|
Package bloom provides a space-efficient probabilistic set membership filter. |
|
Package cms provides a Count-Min Sketch for frequency estimation.
|
Package cms provides a Count-Min Sketch for frequency estimation. |
|
Package hll provides a HyperLogLog cardinality estimator.
|
Package hll provides a HyperLogLog cardinality estimator. |
|
internal
|
|
|
hashutil
Package hashutil provides shared hash mixing constants and functions for probabilistic data structures (Count-Min Sketch, HyperLogLog, MinHash).
|
Package hashutil provides shared hash mixing constants and functions for probabilistic data structures (Count-Min Sketch, HyperLogLog, MinHash). |
|
Package interval provides an augmented interval tree for efficient range-overlap queries.
|
Package interval provides an augmented interval tree for efficient range-overlap queries. |
|
Package levenshtein calculates the Levenshtein edit distance between strings.
|
Package levenshtein calculates the Levenshtein edit distance between strings. |
|
Package lru provides a generic thread-safe LRU cache with optional Bloom pre-filtering, size-based eviction, and cost-aware eviction sampling.
|
Package lru provides a generic thread-safe LRU cache with optional Bloom pre-filtering, size-based eviction, and cost-aware eviction sampling. |
|
Package lsh provides a Locality-Sensitive Hashing index for fast approximate nearest-neighbor retrieval of MinHash signatures.
|
Package lsh provides a Locality-Sensitive Hashing index for fast approximate nearest-neighbor retrieval of MinHash signatures. |
|
Package mapx provides generic map operations: clone, merge, and sorted-key extraction.
|
Package mapx provides generic map operations: clone, merge, and sorted-key extraction. |
|
Package minhash provides MinHash signature generation for set similarity estimation.
|
Package minhash provides MinHash signature generation for set similarity estimation. |
|
Package stats provides core statistical functions for numerical analysis.
|
Package stats provides core statistical functions for numerical analysis. |