bitset

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT 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
}

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

func New

func New() *IntSet

New new an entry

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(args ...int)

AddAll 一次性添加多个int

func (*IntSet) Clear

func (s *IntSet) Clear()

Clear清空

func (*IntSet) Copy

func (s *IntSet) Copy() *IntSet

Copy copy value

func (*IntSet) DifferenceWith

func (s *IntSet) DifferenceWith(t *IntSet)

DifferenceWith A与B的差集,元素出现在A未出现在B

func (*IntSet) Elems

func (s *IntSet) Elems() []int

Elems 获取比特数组中的所有元素的slice集合

func (*IntSet) Has

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

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

func (*IntSet) IntersectWith

func (s *IntSet) IntersectWith(t *IntSet)

IntersectWith A与B的并集,A与B中均出现

func (*IntSet) Len

func (s *IntSet) Len() int

Len len

func (*IntSet) Remove

func (s *IntSet) Remove(x int)

Remove 移除元素

func (*IntSet) String

func (s *IntSet) String() string

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

func (*IntSet) SymmetricDifference

func (s *IntSet) SymmetricDifference(t *IntSet)

SymmetricDifference A与B的并差集,元素出现在A没有出现在B,或出现在B没有出现在A

func (*IntSet) UnionWith

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

UnionWith A与B的交集,合并A与B 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