ch6_intset

package
v0.0.0-...-5afa7de Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntSet

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

An IntSet is a set of small non-negative integers. Its zero value represents the empty set.

func (*IntSet) Add

func (s *IntSet) Add(x int)

Add adds the non-negative value x to the set.

func (*IntSet) AddAll

func (s *IntSet) AddAll(x ...int)

func (*IntSet) Clear

func (s *IntSet) Clear()

Clear remove all elements from the set

func (*IntSet) Copy

func (s *IntSet) Copy() *IntSet

Copy return a copy of the set

func (*IntSet) Has

func (s *IntSet) Has(x int) bool

Has reports whether the set contains the non-negative value x.

func (*IntSet) Len

func (s *IntSet) Len() int

Len return the number of elements

func (*IntSet) Remove

func (s *IntSet) Remove(x int)

Remove remove x from the set

func (*IntSet) String

func (s *IntSet) String() string

String returns the set as a string of te form "{1 2 3}"

func (*IntSet) UnionWith

func (s *IntSet) UnionWith(t *IntSet)

UnionWith sets s to the union of s and t.

Jump to

Keyboard shortcuts

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