MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / union

Method union

src/data_structures/union_find.rs:53–59  ·  view source on GitHub ↗

Unites the sets containing the two given values. Returns: - `None` if either value hasn't been inserted, - `Some(true)` if two disjoint sets have been merged, - `Some(false)` if both elements were already in the same set.

(&mut self, first_item: &T, sec_item: &T)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

test_spanning_treeFunction · 0.80

Calls 2

union_by_keyMethod · 0.80
findMethod · 0.45

Tested by 1

test_spanning_treeFunction · 0.64