An instance P of the data type Union_find<T,A> is a partition of values of type T into disjoint sets. The template parameter A has to be a model of the allocator concept as defined in the C++ standard. It has a default argument CGAL_ALLOCATOR(T).
#include <CGAL/Union_find.h>
Union_find<T,A>::value_type | |
values stored in items (equal to T).
| |
Union_find<T,A>::handle | |
handle to values.
| |
Union_find<T,A>::iterator | |
iterator over values.
|
There are also constant versions const_handle and const_iterator.
Union_find<T,A>::allocator | |
allocator.
|
Union_find<T,A> P; | |
creates an instance P of type
Union_find<T,A> and initializes it to the empty partition.
|
Union_find<T,A> is implemented with union by rank and path compression. The running time for m set operations on n elements is O(n α(m,n)) where α(m,n) is the extremely slow growing inverse of Ackermann's function.