set

package
v0.0.0-...-6fd8457 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package set provides a simple set implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disjoint

func Disjoint[T key](a, b Set[T]) bool

Disjoint returns true if two sets are disjoint

func Equal

func Equal[T key](a, b Set[T]) bool

Equal returns true if two sets are equal

func Subset

func Subset[T key](a, b Set[T]) bool

Subset returns true if a is a subset of b

func Superset

func Superset[T key](a, b Set[T]) bool

Superset returns true if a is a superset of b

Types

type Set

type Set[T key] struct {
	// contains filtered or unexported fields
}

func Diff

func Diff[T key](a, b Set[T]) Set[T]

Diff returns the difference between two sets

func Intersect

func Intersect[T key](a, b Set[T]) Set[T]

Intersect returns the intersection between two sets

func Make

func Make[T key](size int) Set[T]

func New

func New[T key](v ...T) Set[T]

func Union

func Union[T key](a, b Set[T]) Set[T]

Union returns the union between two sets

func Xor

func Xor[T key](a, b Set[T]) Set[T]

Xor returns the symmetric difference between two sets

func (Set[T]) Contains

func (s Set[T]) Contains(v T) bool

func (Set[T]) ContainsAll

func (s Set[T]) ContainsAll(v ...T) bool

func (Set[T]) Insert

func (s Set[T]) Insert(v ...T)

func (Set[T]) Len

func (s Set[T]) Len() int

func (Set[T]) Remove

func (s Set[T]) Remove(v ...T)

func (Set[T]) Slice

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

Jump to

Keyboard shortcuts

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