History of Idiom 119 > diff from v31 to v32
Edit summary for version 32 by canonical.chris:
[Java] clarify the comment
[Java] clarify the comment
↷
Version 31
2018-04-07, 10:20:55
Version 32
2018-04-07, 10:23:14
Idiom #119 Deduplicate list
Remove duplicates from list x.
Explain if original order is preserved.
Idiom #119 Deduplicate list
Remove duplicates from list x.
Explain if original order is preserved.
Comments bubble
Upon first occurrence, store item in seen; all future occurrences of the item remove it from the list via the iterator, which removes the last-returned item.
Comments bubble
Upon first occurrence, store item in seen; all future occurrences of the item are removed from the list efficiently via the iterator listIt, removing the last-returned item.
Requires extra memory for the hash-set.