linked list: cleanup in partition
linked list: cleanup in remove_duplicates