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.
Click to show internal directories.
Click to hide internal directories.