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

Method find_set

src/graph/disjoint_set_union.rs:56–61  ·  view source on GitHub ↗

Finds the representative (root) of the set containing `element` with path compression. Path compression ensures that future queries are faster by directly linking all nodes in the path to the root. # Parameters - `element`: The element whose set representative is being found. # Returns The root representative of the set containing `element`.

(&mut self, element: usize)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

mergeMethod · 0.80
calculate_answersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected