func (m *BottomK) Cardinality() int {
	return int(float64(len(*m.minimums)-1) / (float64((*m.minimums)[0]) / float64(math.MaxUint64)))
}
Cardinality estimates the cardinality of the set
package minhash
import (
	"container/heap"
	"math"
	"sort"
)
type intHeap []uint64
func (h intHeap) Len() int { return len(h) }
func (h intHeap) Less(i, j int) bool { return h[i] > h[j] }
func (h intHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }
func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(uint64))
}
func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}
type BottomK struct {
	size     int
	h        Hash64
	minimums *intHeap
}
func NewBottomK(h Hash64, k int) *BottomK {
	return &BottomK{
		size:     k,
		h:        h,
		minimums: &intHeap{},
	}
}
func (m *BottomK) Push(b []byte) {
	i64 := m.h(b)
	if i64 == 0 {
		return
	}
	if len(*m.minimums) < m.size {
		heap.Push(m.minimums, i64)
		return
	}
	if i64 < (*m.minimums)[0] {
		(*m.minimums)[0] = i64
		heap.Fix(m.minimums, 0)
	}
}
func (m *BottomK) Merge(m2 *BottomK) {
	for _, v := range *m2.minimums {
		if len(*m.minimums) < m.size {
			heap.Push(m.minimums, v)
			continue
		}
		if v < (*m.minimums)[0] {
			(*m.minimums)[0] = v
			heap.Fix(m.minimums, 0)
		}
	}
}