datastructures

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 1 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

func MakeSet

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

MakeSet initialize the set

func MakeSetFromElements added in v1.5.0

func MakeSetFromElements[T comparable](elements ...T) *Set[T]

func (*Set[T]) Add

func (set *Set[T]) Add(key T)

func (*Set[T]) AddElements added in v1.5.0

func (set *Set[T]) AddElements(elements ...T)

func (*Set[T]) Exists

func (set *Set[T]) Exists(key T) bool

func (*Set[T]) Intersect added in v1.6.0

func (set *Set[T]) Intersect(setB *Set[T]) *Set[T]

func (*Set[T]) Remove

func (set *Set[T]) Remove(key T) error

func (*Set[T]) Size

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

func (*Set[T]) ToSlice

func (set *Set[T]) ToSlice() []T

func (*Set[T]) Union added in v1.6.0

func (set *Set[T]) Union(setB *Set[T]) *Set[T]

Jump to

Keyboard shortcuts

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