Documentation
¶
Overview ¶
hash set
Index ¶
- type Set
- func (s Set[T]) Clear() Set[T]
- func (s Set[T]) Clone() Set[T]
- func (s Set[T]) Contain(val T) bool
- func (s Set[T]) ContainAndRemove(val T) (ok bool)
- func (s Set[T]) CopyFrom(set Set[T]) Set[T]
- func (s Set[T]) Difference(set Set[T]) (diff Set[T])
- func (s Set[T]) Equal(set Set[T]) (b bool)
- func (s Set[T]) Insert(val T) bool
- func (s Set[T]) Intersection(set Set[T]) (intersection Set[T])
- func (s Set[T]) IsEmpty() bool
- func (s Set[T]) IsSubSet(set Set[T]) (b bool)
- func (s Set[T]) IsSupperSet(set Set[T]) (b bool)
- func (s Set[T]) Len() int
- func (s Set[T]) Push(val ...T) Set[T]
- func (s Set[T]) Range(f func(val T) (Continue bool))
- func (s Set[T]) Remove(val T) bool
- func (s Set[T]) Slice() []T
- func (s Set[T]) SymmetricDifference(set Set[T]) (diff Set[T])
- func (s Set[T]) Union(set ...Set[T]) (union Set[T])
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[T constraints.Ordered] map[T]struct{}
func (Set[T]) Contain ¶
If value is not in the set, return true. If value is in the set, return false.
func (Set[T]) ContainAndRemove ¶
If value is in the set, return true and remove it.
func (Set[T]) Difference ¶
Contains all elements in the original s but not in the set
func (Set[T]) Insert ¶
Slice returns a slice of the set. If value is not in the set, return true. If value is in the set, return false.
func (Set[T]) Intersection ¶
Contains all elements in s and set.
func (Set[T]) IsSupperSet ¶
If s is a supper set of set, return true.
func (Set[T]) Remove ¶
Remove removes the value from the set. If value is in the set, return true. If value is not in the set, return false.
func (Set[T]) SymmetricDifference ¶
Contains all elements in s or set but not both.
Click to show internal directories.
Click to hide internal directories.