An Algorithm to Find Equivalence Classes

The purpose of this algorithm is to Find the equivalence class of a particular element in a set and all disjoint classes of a set. The algorithm works on an equivalence relation.