MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / find

Method find

nodedb/src/engine/graph/algo/wcc.rs:71–78  ·  view source on GitHub ↗

Find the root of the set containing `x` with path compression.

(&mut self, mut x: usize)

Source from the content-addressed store, hash-verified

69
70 /// Find the root of the set containing `x` with path compression.
71 fn find(&mut self, mut x: usize) -> usize {
72 while self.parent[x] != x {
73 // Path halving: point to grandparent.
74 self.parent[x] = self.parent[self.parent[x]];
75 x = self.parent[x];
76 }
77 x
78 }
79
80 /// Union the sets containing `a` and `b` by rank.
81 fn union(&mut self, a: usize, b: usize) {

Callers 15

mainFunction · 0.45
convert_collection_typeFunction · 0.45
validate_signatureFunction · 0.45
replace_case_insensitiveFunction · 0.45
rollback_toMethod · 0.45
columnar_row_surrogatesFunction · 0.45
convert_insertFunction · 0.45
convert_upsertFunction · 0.45
convert_updateFunction · 0.45
create_policyMethod · 0.45

Calls

no outgoing calls