remove duplicates from Linked List w/ and w/o memory