set

package
v0.0.0-...-4d3d43f Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OSet

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

OSet 此处的items参数可以继续优化,修改为链表存储

func NewOSet

func NewOSet(size int) *OSet

func (*OSet) Append

func (s *OSet) Append(item any)

func (*OSet) Contains

func (s *OSet) Contains(item any) bool

func (*OSet) Copy

func (s *OSet) Copy() *OSet

func (*OSet) Diff

func (s *OSet) Diff(sp *OSet) *OSet

Diff 求差集

func (*OSet) Inter

func (s *OSet) Inter(sp *OSet) *OSet

Inter 求交集

func (*OSet) Iterator

func (s *OSet) Iterator() lib.Iterator

func (*OSet) Remove

func (s *OSet) Remove(item any)

Remove 可能会删除多个元素

func (*OSet) Size

func (s *OSet) Size() int

func (*OSet) Union

func (s *OSet) Union(sp *OSet) *OSet

Union 求合集

type OSetIterator

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

func (*OSetIterator) HasNext

func (oi *OSetIterator) HasNext() bool

func (*OSetIterator) Item

func (oi *OSetIterator) Item() any

func (*OSetIterator) Next

func (oi *OSetIterator) Next()

func (*OSetIterator) Reset

func (oi *OSetIterator) Reset()

type SSet

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

func NewSSet

func NewSSet(size int) *SSet

func (*SSet) Append

func (s *SSet) Append(item any)

func (*SSet) Contains

func (s *SSet) Contains(item any) bool

func (*SSet) Copy

func (s *SSet) Copy() *SSet

func (*SSet) Diff

func (s *SSet) Diff(sp *SSet) *SSet

Diff 求差集

func (*SSet) Inter

func (s *SSet) Inter(sp *SSet) *SSet

Inter 求交集

func (*SSet) Remove

func (s *SSet) Remove(item any) bool

func (*SSet) Size

func (s *SSet) Size() int

func (*SSet) Union

func (s *SSet) Union(sp *SSet) *SSet

Union 求合集

Jump to

Keyboard shortcuts

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