Documentation
¶
Overview ¶
stockings are where you keep the toys a.k.a. data structures
Index ¶
- type BinaryHeap
- func (heap *BinaryHeap[T]) Has(key T) bool
- func (h *BinaryHeap[T]) IncreaseKeyValue(key T) *BinaryHeap[T]
- func (heap *BinaryHeap[T]) IndexOf(key T) int
- func (heap *BinaryHeap[T]) Len() int
- func (heap *BinaryHeap[T]) Less(i, j int) bool
- func (heap *BinaryHeap[T]) Pop() any
- func (h *BinaryHeap[T]) Push(x any)
- func (heap *BinaryHeap[T]) Swap(i, j int)
- type BitSet
- func (bs *BitSet[T]) Any() bool
- func (bs *BitSet[T]) Capacity() int64
- func (bs *BitSet[T]) Clear() *BitSet[T]
- func (bs *BitSet[T]) Has(idx T) bool
- func (bs *BitSet[T]) Intersect(others ...BitSet[T]) BitSet[T]
- func (bs *BitSet[T]) Members() []T
- func (bs *BitSet[T]) Off(idx T) *BitSet[T]
- func (bs *BitSet[T]) On(idx T) *BitSet[T]
- func (bs *BitSet[T]) Size() int64
- func (bs *BitSet[T]) Subtract(other BitSet[T]) *BitSet[T]
- func (bs *BitSet[T]) Union(others ...BitSet[T]) BitSet[T]
- type Integral
- type PriorityQueue
- func (q *PriorityQueue[T]) Add(item T) *PriorityQueue[T]
- func (q *PriorityQueue[T]) GetNext() T
- func (q *PriorityQueue[T]) GetPriority(item T) int
- func (q *PriorityQueue[T]) Has(item T) bool
- func (q *PriorityQueue[T]) IndexOf(key T) int
- func (q *PriorityQueue[T]) Size() int
- func (q *PriorityQueue[T]) TryIncreasePriority(item T) bool
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryHeap ¶
type BinaryHeap[T comparable] struct { // contains filtered or unexported fields }
func NewBinaryHeap ¶
func NewBinaryHeap[T comparable](capacity int, sort func(a, b T) bool) *BinaryHeap[T]
func (*BinaryHeap[T]) Has ¶
func (heap *BinaryHeap[T]) Has(key T) bool
func (*BinaryHeap[T]) IncreaseKeyValue ¶
func (h *BinaryHeap[T]) IncreaseKeyValue(key T) *BinaryHeap[T]
func (*BinaryHeap[T]) IndexOf ¶
func (heap *BinaryHeap[T]) IndexOf(key T) int
func (*BinaryHeap[T]) Len ¶
func (heap *BinaryHeap[T]) Len() int
func (*BinaryHeap[T]) Less ¶
func (heap *BinaryHeap[T]) Less(i, j int) bool
func (*BinaryHeap[T]) Pop ¶
func (heap *BinaryHeap[T]) Pop() any
func (*BinaryHeap[T]) Push ¶
func (h *BinaryHeap[T]) Push(x any)
func (*BinaryHeap[T]) Swap ¶
func (heap *BinaryHeap[T]) Swap(i, j int)
type PriorityQueue ¶
type PriorityQueue[T comparable] struct { // contains filtered or unexported fields }
func NewMaxPriorityQueue ¶
func NewMaxPriorityQueue[T comparable](capacity int, prioritize func(item T) int) *PriorityQueue[T]
func NewMinPriorityQueue ¶
func NewMinPriorityQueue[T comparable](capacity int, prioritize func(item T) int) *PriorityQueue[T]
func (*PriorityQueue[T]) Add ¶
func (q *PriorityQueue[T]) Add(item T) *PriorityQueue[T]
func (*PriorityQueue[T]) GetNext ¶
func (q *PriorityQueue[T]) GetNext() T
func (*PriorityQueue[T]) GetPriority ¶
func (q *PriorityQueue[T]) GetPriority(item T) int
func (*PriorityQueue[T]) Has ¶
func (q *PriorityQueue[T]) Has(item T) bool
func (*PriorityQueue[T]) IndexOf ¶
func (q *PriorityQueue[T]) IndexOf(key T) int
func (*PriorityQueue[T]) Size ¶
func (q *PriorityQueue[T]) Size() int
func (*PriorityQueue[T]) TryIncreasePriority ¶
func (q *PriorityQueue[T]) TryIncreasePriority(item T) bool
Click to show internal directories.
Click to hide internal directories.