a function which takes two "any" types (from elements) and returns true if they are similar, false otherwise.
a list of lists of indices referencing the input list, where each inner list is a cluster of similar element indices.
Given a list of pre-sorted elements, create clusters where similarity is determined by a custom comparison function. Comparisons only need to happen to neighbors due to the array already being sorted. The type of elements in the list doesn't matter, so long as the comparison function can compare them.
a list of elements of any type