Disjoint set datastructure
Knuth-Morris-Pratt algorithm
simple prime generator