package
Version:
v0.0.0-...-6fd8457
Opens a new window with list of versions in this module.
Published: May 23, 2024
License: AGPL-3.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package set provides a simple set implementation.
func Disjoint[T key](a, b Set[T]) bool
Disjoint returns true if two sets are disjoint
func Equal[T key](a, b Set[T]) bool
Equal returns true if two sets are equal
func Subset[T key](a, b Set[T]) bool
Subset returns true if a is a subset of b
func Superset[T key](a, b Set[T]) bool
Superset returns true if a is a superset of b
type Set[T key] struct {
}
func Diff[T key](a, b Set[T]) Set[T]
Diff returns the difference between two sets
func Intersect[T key](a, b Set[T]) Set[T]
Intersect returns the intersection between two sets
func Make[T key](size int) Set[T]
func New[T key](v ...T) Set[T]
func Union[T key](a, b Set[T]) Set[T]
Union returns the union between two sets
func Xor[T key](a, b Set[T]) Set[T]
Xor returns the symmetric difference between two sets
func (s Set[T]) ContainsAll(v ...T) bool
func (s Set[T]) Insert(v ...T)
func (s Set[T]) Remove(v ...T)
func (s Set[T]) Slice() []T
Source Files
¶
Click to show internal directories.
Click to hide internal directories.