Data structure that keeps elements in chronological order and doesn't contain duplicates

Revision en1, by Qualified, 2020-07-25 19:00:11

I know that set doesn't contain duplicates, but it sorts the elements. I want a data structure that doesn't sort the elements and doesn't contain duplicates.

For example if the data structure contains ints,

Input: 5 4 1 2 5 4 9

Elements in data structure

5 4 1 2 9

Please help.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Qualified 2020-07-25 19:00:11 380 Initial revision (published)