mirror of https://github.com/CGAL/cgal
Add a comment to the get_hash method
This commit is contained in:
parent
4f9bb66292
commit
104aca6295
|
|
@ -65,6 +65,16 @@ class ID_support_handler<SNC_indexed_items, Decorator> {
|
||||||
hash.reserve(n);
|
hash.reserve(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The method get_hash implements a
|
||||||
|
// two-pass union find algorithm
|
||||||
|
// __ __ _______
|
||||||
|
// / \ / \ / _____\
|
||||||
|
// _|__|__|__|_ _/__/__/__|_
|
||||||
|
// | | v | v | | | | | v |
|
||||||
|
// | O O O O | => | O O O O |
|
||||||
|
// |____|__^____| |____________|
|
||||||
|
// | | root
|
||||||
|
// \_/
|
||||||
int get_hash(int i) {
|
int get_hash(int i) {
|
||||||
int root(i);
|
int root(i);
|
||||||
while(hash[root] != root)
|
while(hash[root] != root)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue