Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QuickFind ¶
type QuickFind struct {
// contains filtered or unexported fields
}
QuickFind M union-find ops on a N objects worst time complexity is O(MN)
func NewQuickFind ¶
type QuickUnion ¶
type QuickUnion struct {
// contains filtered or unexported fields
}
QuickUnion M union-find ops on a N Objects worst time complexity is O(MN)
func NewQuickUnion ¶
func NewQuickUnion(n int) *QuickUnion
QuickUnion is also slow, tree is not flat
func (*QuickUnion) Find ¶
func (qu *QuickUnion) Find(i, j int) bool
Find time complexity proportional to depth of i/j worst case O(N)
func (*QuickUnion) Union ¶
func (qu *QuickUnion) Union(i, j int)
Union just like Find, time complexity Worst Case O(N)
type WQUPC ¶
type WQUPC struct {
// contains filtered or unexported fields
}
WQUPC M union-find ops on a N objects worst time complexity is o((N+M)*lgN)
type WeightedQuickUnion ¶
type WeightedQuickUnion struct {
// contains filtered or unexported fields
}
WeightedQuickUnion M union-find ops on a N objects worst time complexity is o(N+MlgN)
func NewWeightedQuickUnion ¶
func NewWeightedQuickUnion(n int) *WeightedQuickUnion
func (*WeightedQuickUnion) Find ¶
func (qu *WeightedQuickUnion) Find(i, j int) bool
Find time complexity proportional to depth of i/j, depth is at most lgN worst case O(lgN)
func (*WeightedQuickUnion) Union ¶
func (qu *WeightedQuickUnion) Union(i, j int)
Union just like Find, time complexity Worst Case O(lgN)
Click to show internal directories.
Click to hide internal directories.