xslices

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Difference

func Difference[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice

Difference computes difference of two slices.

func FastDelete added in v1.1.0

func FastDelete[S ~[]E, E any](s S, i int) S

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

func Intersection[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice

Intersection computes intersection of two slices.

func SetDifference

func SetDifference[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice

SetDifference returns a slice that contains elements from the first sorted slice that are not found in the second sorted slice.

func SetDifferenceFunc

func SetDifferenceFunc[E any, Slice ~[]E](s1, s2 Slice, comp func(E, E) int) Slice

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

func SetIntersection[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice

SetIntersection computes intersection of two sorted slices.

func SetIntersectionFunc

func SetIntersectionFunc[E any, Slice ~[]E](s1, s2 Slice, comp func(E, E) int) Slice

SetIntersectionFunc computes intersection of two sorted slices using a comparison function.

func SetSymmetricDifference

func SetSymmetricDifference[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) (first, second Slice)

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 SetUnion

func SetUnion[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) Slice

SetUnion computes union of two sorted slices.

func SetUnionFunc

func SetUnionFunc[E any, Slice ~[]E](s1, s2 Slice, comp func(E, E) int) Slice

SetUnionFunc computes union of two sorted slices using a comparison function.

func SymmetricDifference

func SymmetricDifference[E cmp.Ordered, Slice ~[]E](s1, s2 Slice) (first, second Slice)

SymmetricDifference computes symmetric difference of two slices.

func Union

func Union[E cmp.Ordered, Slice ~[]E](s ...Slice) Slice

Union computes union of two slices.

Types

This section is empty.

Jump to

Keyboard shortcuts

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