Tessero\Cluster\Hierarchy\DisjointSet
AI assistant
Build this with Claude Code, Cursor or Copilot
Copy a Tessero-tuned prompt for Tessero\Cluster\Hierarchy\DisjointSet, grounded in 9 real API signatures , into your IDE's AI. No chatbot, just exact context.
__construct
__construct(?iterable $elements = null)
add
add(string|int|float|bool $x): void
Add an element to the disjoint set (no-op if present). scipy DisjointSet.add.
find
find(string|int|float|bool $x): string|int|float|bool
The root element value of $x (scipy __getitem__ / find).
merge
merge(string|int|float|bool $x, string|int|float|bool $y): bool
Merge the subsets containing $x and $y. The smaller subset is attached to the larger; on a tie the earlier-inserted root wins. Returns true iff they were in different subsets. scipy merge.
connected
connected(string|int|float|bool $x, string|int|float|bool $y): bool
Whether $x and $y are in the same subset. scipy connected.
subset
subset(string|int|float|bool $x): array
The subset containing $x, as a list of element values in the subset's internal circular order (scipy returns a Python set; order is not significant). scipy subset.
subsetSize
subsetSize(string|int|float|bool $x): int
The size of the subset containing $x, without materializing it. scipy subset_size.
subsets
subsets(): array
All subsets, each a list of element values, in the order subsets are first encountered scanning elements by insertion order. scipy subsets.
count
count(): int
getIterator
getIterator(): Traversable