Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UnionFind4 ¶
type UnionFind4 struct {
// contains filtered or unexported fields
}
我们的第四版Union-Find
func (*UnionFind4) GetSize ¶
func (u4 *UnionFind4) GetSize() int
func (*UnionFind4) IsConnected ¶
func (u4 *UnionFind4) IsConnected(p int, q int) bool
查看元素p和元素q是否所属一个集合 O(h)复杂度, h为树的高度
func (*UnionFind4) UnionElements ¶
func (u4 *UnionFind4) UnionElements(p int, q int)
合并元素p和元素q所属的集合 O(h)复杂度, h为树的高度
Click to show internal directories.
Click to hide internal directories.