Usage of set
The main function of set is to reorder automatically in ascending order. Set is translated into a set, which is an internally sorted container and does not contain duplicate elements.

C++ STL is widely praised and used by many people. It not only provides convenient containers such as vector, string and list, but more importantly, STL encapsulates many complex data structure algorithms and a large number of commonly used data structure operations.

Vector encapsulates array, list encapsulates linked list, map and set encapsulates binary tree, etc. When encapsulating these data structures, STL provides common operations in the form of member functions, such as inserting, sorting, deleting, searching and so on, according to programmers' usage habits. Users will not feel strange when using STL.

With regard to sets, attention must be paid to the set relation container. As a container, Set is also used to store data types of the same data type, and can fetch data from a data set. The value of each element in the collection is unique, and the system can automatically sort according to the value of the element.

It should be noted that the value of the number element in the set cannot be changed directly. The standard association containers Set, multiset, map and multimap in C++ STL are a very efficient balanced binary tree: red-black tree, also known as RB tree. The statistical performance of RB tree is better than that of general balanced binary tree, so it is selected as the internal structure of associative container by STL.