set

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elem

type Elem int

type IntSet

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

Set implements a basic set data structure.

func (*IntSet) Add

func (s *IntSet) Add(v int) bool

Add adds the element to the set.

func (*IntSet) Del

func (s *IntSet) Del(v int) bool

Del removes the element from the set.

func (*IntSet) DifferenceWith

func (s *IntSet) DifferenceWith(ss *IntSet)

DifferenceWith sets s to all the elements not in the intersection of s and ss.

func (*IntSet) Has

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

Has returns whether or not the element in the set.

func (*IntSet) Intersectionwith

func (s *IntSet) Intersectionwith(ss *IntSet)

IntersectionWith removes all the elements from s that are not in s and ss.

func (*IntSet) Len

func (s *IntSet) Len() int

Len returns the number of elements in the set.

func (*IntSet) Unionwith

func (s *IntSet) Unionwith(ss *IntSet)

UnionWith performs the union of the two sets into s.

type Set

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

Set implements a basic set data structure.

func (*Set) Add

func (s *Set) Add(v Elem) bool

Add adds the element to the set.

func (*Set) Del

func (s *Set) Del(v Elem) bool

Del removes the element from the set.

func (*Set) DifferenceWith

func (s *Set) DifferenceWith(ss *Set)

DifferenceWith sets s to all the elements not in the intersection of s and ss.

func (*Set) Has

func (s *Set) Has(v Elem) bool

Has returns whether or not the element in the set.

func (*Set) Intersectionwith

func (s *Set) Intersectionwith(ss *Set)

IntersectionWith removes all the elements from s that are not in s and ss.

func (*Set) Len

func (s *Set) Len() int

Len returns the number of elements in the set.

func (*Set) Unionwith

func (s *Set) Unionwith(ss *Set)

UnionWith performs the union of the two sets into s.

Jump to

Keyboard shortcuts

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