stockings

package
v0.0.0-...-223f09d Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

stockings are where you keep the toys a.k.a. data structures

Index

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 BitSet

type BitSet[T Integral] struct {
	// contains filtered or unexported fields
}

func (*BitSet[T]) Any

func (bs *BitSet[T]) Any() bool

func (*BitSet[T]) Capacity

func (bs *BitSet[T]) Capacity() int64

func (*BitSet[T]) Clear

func (bs *BitSet[T]) Clear() *BitSet[T]

func (*BitSet[T]) Has

func (bs *BitSet[T]) Has(idx T) bool

func (*BitSet[T]) Intersect

func (bs *BitSet[T]) Intersect(others ...BitSet[T]) BitSet[T]

func (*BitSet[T]) Members

func (bs *BitSet[T]) Members() []T

func (*BitSet[T]) Off

func (bs *BitSet[T]) Off(idx T) *BitSet[T]

func (*BitSet[T]) On

func (bs *BitSet[T]) On(idx T) *BitSet[T]

func (*BitSet[T]) Size

func (bs *BitSet[T]) Size() int64

func (*BitSet[T]) Subtract

func (bs *BitSet[T]) Subtract(other BitSet[T]) *BitSet[T]

func (*BitSet[T]) Union

func (bs *BitSet[T]) Union(others ...BitSet[T]) BitSet[T]

type Integral

type Integral interface {
	~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uint |
		~int8 | ~int16 | ~int32 | ~int64 | ~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

type Stack

type Stack[T any] struct {
	// contains filtered or unexported fields
}

func (*Stack[T]) Peek

func (stack *Stack[T]) Peek() T

func (*Stack[T]) PeekTop

func (stack *Stack[T]) PeekTop(count int) []T

func (*Stack[T]) Pop

func (stack *Stack[T]) Pop() T

func (*Stack[T]) Push

func (stack *Stack[T]) Push(items ...T) *Stack[T]

func (*Stack[T]) Size

func (stack *Stack[T]) Size() int

func (*Stack[T]) Top

func (stack *Stack[T]) Top(count int) []T

Jump to

Keyboard shortcuts

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