Documentation ¶
Overview ¶
Package set provides integer and graph.Node sets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ints ¶
type Ints[T Int] map[T]struct{}
type Nodes ¶
Nodes is a set of nodes keyed in their integer identifiers.
func IntersectionOfNodes ¶
IntersectionOfNodes returns the intersection of a and b.
The intersection of two sets, a and b, is the set containing all the elements shared between the two sets, for instance:
{a,b,c} INTERSECT {b,c,d} = {b,c}
The intersection between a set and itself is itself, and thus effectively a copy operation:
{a,b,c} INTERSECT {a,b,c} = {a,b,c}
The intersection between two sets that share no elements is the empty set:
{a,b,c} INTERSECT {d,e,f} = {}
func NewNodesSize ¶
NewNodesSize returns a new Nodes with the given size hint, n.
func UnionOfNodes ¶
UnionOfNodes returns the union of a and b.
The union of two sets, a and b, is the set containing all the elements of each, for instance:
{a,b,c} UNION {d,e,f} = {a,b,c,d,e,f}
Since sets may not have repetition, unions of two sets that overlap do not contain repeat elements, that is:
{a,b,c} UNION {b,c,d} = {a,b,c,d}