Documentation ¶
Index ¶
- Constants
- type Set
- func (s1 Set) Add(s2 Set)
- func (s Set) Attach() *SetIterator
- func (s Set) Clear(min, max int)
- func (s Set) Copy() Set
- func (s1 Set) Diff(s2 Set) Set
- func (s1 Set) Equal(s2 Set) bool
- func (s Set) Excl(e int)
- func (s Set) Fill(min, max int)
- func (s Set) In(e int) bool
- func (s Set) Incl(e int)
- func (s1 Set) Inter(s2 Set) Set
- func (s Set) IsEmpty() bool
- func (s Set) NbElems() int
- func (s1 Set) Subset(s2 Set) bool
- func (s1 Set) Union(s2 Set) Set
- func (s1 Set) XOR(s2 Set) Set
- type SetIterator
Constants ¶
View Source
const ( SMin = 0 // The smallest integer in sets. SMax = 1<<31 - 2 // The largest integer in sets. )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set map[int]void
Set of non-negative integers.
func (Set) Attach ¶
func (s Set) Attach() *SetIterator
Attach the set s to a SetIterator and return the later.
type SetIterator ¶
type SetIterator struct {
// contains filtered or unexported fields
}
func (*SetIterator) FirstE ¶
func (i *SetIterator) FirstE() (e int, ok bool)
On return, e contains the first element of the set attached to i. Returns true in ok if such an element exists. Usage: e, ok := i.FirstE(); for ok { ... e, ok = i.NextE()}
func (*SetIterator) NextE ¶
func (i *SetIterator) NextE() (e int, ok bool)
On return, e contains the next element of the set attached to i. Returns true in ok if such an element exists. i.FirstE must have been called once before i.NextE. Usage: e, ok := i.FirstE(); for ok { ... e, ok = i.NextE()}
Click to show internal directories.
Click to hide internal directories.