Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
BloomFilter represents a Bloom filter data structure
func NewBloomFilter ¶
func NewBloomFilter(expectedElements int, falsePositiveRate float64) *BloomFilter
NewBloomFilter creates a new Bloom filter with the given size and desired false positive rate
func (*BloomFilter) Add ¶
func (bf *BloomFilter) Add(data []byte)
Add adds an element to the Bloom filter
func (*BloomFilter) Contains ¶
func (bf *BloomFilter) Contains(data []byte) bool
Contains checks if an element might be in the set
func (*BloomFilter) EstimateFalsePositiveRate ¶
func (bf *BloomFilter) EstimateFalsePositiveRate(numElements int) float64
EstimateFalsePositiveRate estimates the current false positive rate
type HashNode ¶
type HashNode struct { Key interface{} Value interface{} Next *HashNode // Used for chaining collision resolution }
HashNode represents a key-value pair in the hash table
type HashTable ¶
type HashTable struct { Size int Capacity int Table []*HashNode Strategy string // "linear" for linear probing, "chain" for chaining // contains filtered or unexported fields }
HashTable represents the hash table data structure
func NewHashTable ¶
NewHashTable creates a new hash table with specified capacity and collision resolution strategy
Click to show internal directories.
Click to hide internal directories.