ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ListMFSet.h File Reference

The MFSET on lists of section 10.2.1 [see MFSet.h], each element knowing the head of its list: find() in \( O( 1 ) \), merge() relabels the shorter list, so that an element is relabeled at most \( \log_2 n \) times. More...

#include "ADS/Contract.h"
#include <stdexcept>
#include <utility>
#include <vector>
#include "ADS/mfset/impl/ListMFSet.tpp"

Go to the source code of this file.

Classes

class  ADS::ListMFSet
 the union of disjoint sets on lists, each element with the head of its list More...

Namespaces

namespace  ADS

Detailed description

The MFSET on lists of section 10.2.1 [see MFSet.h], each element knowing the head of its list: find() in \( O( 1 ) \), merge() relabels the shorter list, so that an element is relabeled at most \( \log_2 n \) times.

The contracts [see Contract.h]: the elements are in \( [ 0 , n ) \), and after merge() \( x \) and \( y \) have the same head; the invariant is that each element is once in the list of its head. The operations are defined in ListMFSet.tpp.

See also
A. Montresor, Algoritmi e Strutture Dati, 2025, section 10.2.1, https://algoritmicamente.it/materiali/libro/capitoli/cap10.pdf
J. E. Hopcroft, J. D. Ullman, Set merging algorithms, SIAM Journal on Computing 2(4), 294-303, 1973, doi:10.1137/0202024
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa