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.