Sort the list.

Since it's a linked list, you can't use qsort. Mergesort is a good linked list sort algorithm.

Now it's trivial to pick out the unique instances. A unique instance is either the first in the list, or an instance with a non-equal prior.