collection

package
v0.0.0-...-3839eb7 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComplementSet

func ComplementSet[E comparable](s1, s2 []E) []E

ComplementSet return the complement set of s2 relative to s1

func DifferenceSet

func DifferenceSet[E comparable](s1, s2 []E) []E

DifferenceSet return the difference set of s2 relative to s1

func IsSubset

func IsSubset[E comparable](s1, s2 []E) bool

IsSubset if the s2 contains all the elements in s1 return true or return false time O(n) space O(n), another way is sort the s2 firstly then use binary search in each element in s1.

Types

This section is empty.

Jump to

Keyboard shortcuts

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