collection

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitset

type Bitset struct {
	// contains filtered or unexported fields
}

func NewBitset

func NewBitset(n int) Bitset

func (Bitset) Bytes

func (b Bitset) Bytes() []byte

func (Bitset) Contains

func (b Bitset) Contains(n int) bool

func (Bitset) Copy

func (b Bitset) Copy() Bitset

func (Bitset) GetLength

func (b Bitset) GetLength() int

func (Bitset) Intersection

func (b Bitset) Intersection(o Bitset) Bitset

func (Bitset) IsZero

func (b Bitset) IsZero() bool

func (Bitset) Union

func (b Bitset) Union(o Bitset) Bitset

func (Bitset) Up

func (b Bitset) Up(n int) Bitset

type BitsetDict

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

func NewBitsetDict

func NewBitsetDict[T any]() *BitsetDict[T]

func (*BitsetDict[T]) Contains

func (d *BitsetDict[T]) Contains(bs Bitset) bool

func (*BitsetDict[T]) Get

func (d *BitsetDict[T]) Get(bs Bitset) (T, bool)

func (*BitsetDict[T]) Set

func (d *BitsetDict[T]) Set(bs Bitset, v T) *BitsetDict[T]

type Pair

type Pair[T, W comparable] struct {
	First  T
	Second W
}

func NewPair

func NewPair[T, W comparable](first T, second W) Pair[T, W]

type Set

type Set[T comparable] struct {
	Mp    map[T]struct{}
	Elems []T
}

func NewSet

func NewSet[T comparable]() *Set[T]

func (*Set[T]) Contains

func (s *Set[T]) Contains(x T) bool

func (*Set[T]) Copy

func (s *Set[T]) Copy() *Set[T]

func (*Set[T]) Difference

func (s *Set[T]) Difference(other *Set[T]) *Set[T]

func (*Set[T]) Erase

func (s *Set[T]) Erase(x T) *Set[T]

func (*Set[T]) Insert

func (s *Set[T]) Insert(x T) *Set[T]

func (*Set[T]) Intersection

func (s *Set[T]) Intersection(other *Set[T]) *Set[T]

func (*Set[T]) Iterator

func (s *Set[T]) Iterator() *setIterator[T]

func (*Set[T]) Size

func (s *Set[T]) Size() int

func (*Set[T]) Slice

func (s *Set[T]) Slice() []T

func (*Set[T]) Union

func (s *Set[T]) Union(other *Set[T]) *Set[T]

type Sha

type Sha = [sha256.Size]byte

type UnionFind

type UnionFind struct {
	// contains filtered or unexported fields
}

func NewUnionFind

func NewUnionFind(n int) *UnionFind

func (*UnionFind) Find

func (uf *UnionFind) Find(x int) int

func (*UnionFind) Group

func (uf *UnionFind) Group() [][]int

func (*UnionFind) Same

func (uf *UnionFind) Same(x, y int) bool

func (*UnionFind) Size

func (uf *UnionFind) Size(x int) int

func (*UnionFind) Unite

func (uf *UnionFind) Unite(x, y int) bool

Jump to

Keyboard shortcuts

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