Documentation
¶
Index ¶
- func Difference[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice
- func FastDelete[S ~[]E, E any](s S, i int) S
- func Intersection[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice
- func SetDifference[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice
- func SetDifferenceFunc[E any, Slice ~[]E](s1, s2 Slice, comp func(E, E) int) Slice
- func SetIntersection[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice
- func SetIntersectionFunc[E any, Slice ~[]E](s1, s2 Slice, comp func(E, E) int) Slice
- func SetSymmetricDifference[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) (first, second Slice)
- func SetSymmetricDifferenceFunc[E any, Slice ~[]E](s1, s2 Slice, comp func(E, E) int) (first, second Slice)
- func SetUnion[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice
- func SetUnionFunc[E any, Slice ~[]E](s1, s2 Slice, comp func(E, E) int) Slice
- func SymmetricDifference[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) (first, second Slice)
- func Union[E cmp.Ordered, Slice ~[]E](s ...Slice) Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Difference ¶
Difference computes difference of two slices.
func FastDelete ¶ added in v1.1.0
FastDelete removes the element s[i] from s, returning the modified slice. Panics if i > len(s). Performs fast removal without preserving order of the elements.
func Intersection ¶
Intersection computes intersection of two slices.
func SetDifference ¶
SetDifference returns a slice that contains elements from the first sorted slice that are not found in the second sorted slice.
func SetDifferenceFunc ¶
SetDifferenceFunc returns a slice that contains elements from the first sorted slice that are not found in the second sorted slice using a comparison function.
func SetIntersection ¶
SetIntersection computes intersection of two sorted slices.
func SetIntersectionFunc ¶
SetIntersectionFunc computes intersection of two sorted slices using a comparison function.
func SetSymmetricDifference ¶
SetSymmetricDifference computes symmetric difference of two sorted slices.
func SetSymmetricDifferenceFunc ¶
func SetSymmetricDifferenceFunc[E any, Slice ~[]E](s1, s2 Slice, comp func(E, E) int) (first, second Slice)
Computes symmetric difference of two sorted slices using a comparison function.
func SetUnionFunc ¶
SetUnionFunc computes union of two sorted slices using a comparison function.
func SymmetricDifference ¶
SymmetricDifference computes symmetric difference of two slices.
Types ¶
This section is empty.