Documentation ¶
Index ¶
- type UnionFindSets
- func (ufs UnionFindSets) Distinct(objects ...interface{}) []interface{}
- func (ufs UnionFindSets) Find(objects ...interface{}) (result []interface{})
- func (ufs UnionFindSets) InSameSet(a, b interface{}) bool
- func (ufs UnionFindSets) InSameSetSlice(object interface{}, slice []interface{}) bool
- func (ufs UnionFindSets) RemoveSet(object interface{}) (result []interface{})
- func (ufs UnionFindSets) Union(objects ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UnionFindSets ¶
UnionFindSets data structure.
func (UnionFindSets) Distinct ¶
func (ufs UnionFindSets) Distinct(objects ...interface{}) []interface{}
Distinct removes the duplicate objects in any same set.
func (UnionFindSets) Find ¶
func (ufs UnionFindSets) Find(objects ...interface{}) (result []interface{})
Find all set members of objects, with no duplicates.
func (UnionFindSets) InSameSet ¶
func (ufs UnionFindSets) InSameSet(a, b interface{}) bool
InSameSet check if a and b are in the same set
func (UnionFindSets) InSameSetSlice ¶
func (ufs UnionFindSets) InSameSetSlice(object interface{}, slice []interface{}) bool
InSameSetSlice check if object is in the same set with any member of slice.
func (UnionFindSets) RemoveSet ¶
func (ufs UnionFindSets) RemoveSet(object interface{}) (result []interface{})
RemoveSet remove the set object belongs to. returns the removed set members.
func (UnionFindSets) Union ¶
func (ufs UnionFindSets) Union(objects ...interface{})
Union objects into the same set, including the existing set members of objects
Click to show internal directories.
Click to hide internal directories.