Import std.algo.union_find
std.algo.union_find
UnionFind: the Ints from 0 to Count - 1 in sets that start one to each and only ever join, for what's connected to what, as Kruskal's spanning tree and a map's regions ask. Each set has a root that Find gives, and a Find halves its path to the root as it goes, while Union hangs the smaller set under the larger, so either takes nearly constant time.
std/algo/union_find.fb
Types
UnionFind
class
Public Class UnionFind
The Ints from 0 to Count - 1 in sets that only ever join, for what's connected to what.
std/algo/union_find.fb, line 10
-
countvalues, each in a set of its own. A negativecountpanics. -
How many values there are, from 0 to Count - 1.
-
How many sets the values are in.
-
Adds a value in a set of its own, and gives it: the Count before.
-
The root of the
value's set, which every value in it has. A value outside 0 to Count - 1 panics. -
Joins the two values' sets, and tells whether they were apart. A value outside 0 to Count - 1 panics.
-
Whether the two values are in one set. A value outside 0 to Count - 1 panics.
-
How many values are in the
value's set, thevaluetoo. A value outside 0 to Count - 1 panics. -
The sets, each its values from the least up, in the order of their least values.
Report an issue with this page or with FutureBlitz on GitHub.