hashtable

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextLog2

func NextLog2(x uint32) uint32

Henry Warren, "Hacker's Delight", ch. 5.3

Types

type Bucket

type Bucket struct {
	Key []byte
}

type HashTable

type HashTable struct {
	Buckets [][]Bucket
	Stats
	Seed uint64
	// contains filtered or unexported fields
}

func NewHashTable

func NewHashTable(size, extra int, pd, oa, prime bool) *HashTable

func (*HashTable) HashQuality

func (ht *HashTable) HashQuality() float64

The theoretical metric from "Red Dragon Book"

func (*HashTable) Insert

func (ht *HashTable) Insert(ka []byte)

func (*HashTable) Print

func (s *HashTable) Print()

type Stats

type Stats struct {
	Inserts  int
	Cols     int
	Probes   int
	Heads    int
	Dups     int
	Nbuckets int
	Entries  int
	Q        float64
	Dur      time.Duration
	//
	Lines    int
	Size     uint64
	SizeLog2 uint64
	SizeMask uint64
}

Jump to

Keyboard shortcuts

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