Do not feel bad if you have problems understanding sets in general. Most of the math is spent in terms of set theory:
http://en.wikipedia.org/wiki/Set_theory
Think of a collection as a collection of unique, disordered objects. In many ways, it looks like a list:
{1, 2, 3, 4}
but the order is unimportant:
{4, 3, 2, 1} = {1, 2, 3, 4}
and repetitions are ignored:
{1, 1, 2, 3, 4} = {1, 2, 3, 4}
The C ++ collection is an implementation of this mathematical object with an odd function that is sorted inside. But this is just an implementation detail and has nothing to do with understanding the data structure. Sorting is for speed only.
source share