Documentation ¶
Index ¶
- func BackendAdd[S ~[]E, E any](src S, added S) S
- func Distinct[S ~[]E, E comparable](src S) (dst S)
- func DistinctFunc[S ~[]E, E any](src S, eq func(a, b E) bool) (dst S)
- func Except[S ~[]E, E comparable](left S, right S) (dst S)
- func ExceptFunc[S ~[]E, E any](left S, right S, eq func(a, b E) bool) (dst S)
- func FrontAdd[S ~[]E, E any](src S, added S) S
- func LPop[S ~[]E, E any](src S) (first E)
- func RPop[S ~[]E, E any](src S) (last E)
- type ZSets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackendAdd ¶
func BackendAdd[S ~[]E, E any](src S, added S) S
func Distinct ¶
func Distinct[S ~[]E, E comparable](src S) (dst S)
func DistinctFunc ¶
func Except ¶
func Except[S ~[]E, E comparable](left S, right S) (dst S)
Except 返回在 left 但是不在 right 中的 left 元素
func ExceptFunc ¶
Types ¶
type ZSets ¶
type ZSets[T comparable] struct { A []T B []T }
ZSets Normally, the slices in ZSets requite to be distinct.
func NewZSets ¶
func NewZSets[T comparable](a []T, b []T) ZSets[T]
func (ZSets[T]) AExceptB ¶
func (z ZSets[T]) AExceptB() []T
AExceptB 属于A而不属于B的元素组成的集合,称为B关于A的相对补集,记作A-B或A\B,即A-B={x|x∈A,且x∉B}。
Click to show internal directories.
Click to hide internal directories.