QuickFind
When construct a QuickFind
, we pass as the capacity of the quick find.
We mark the elements in quick find from to (inclusive).
Different algorithms of quick find bring us different growth of the cost, see below:
Type | connected(p, q) |
union(p, q) |
---|---|---|
tango.type.QuickFind(N) |
||
tango.type.WeightedQuickFind(N) |
connected(p, q): boolean
Returns true
iff is connected with , otherwise false
.
count(): number
Gets the number of components which are not connected with each other.
union(p, q): number
Unions with and returns the count()
after union.