Learning Topics

Choose Topics Accordingly

Set in C++

  1. Sets are containers that store unique elements following a specific order. The values are stored in a specific sorted order i.e. either ascending or descending.
  2. The value of the element cannot be modified once it is added to the set, though it is possible to remove and add the modified value of that element.
vector<int>v; Size:1
3
set<int>v; Size: 1
Unique & Sorted Elements
3

Code

  1. Initializing a Set
    CPP
  2. Inset an Element in Set
    CPP
  3. Erase Elements in Set
    CPP
  4. Swap in Set
    CPP
  5. Clear Elements
    CPP
  6. Find and Erase Elements in Set
    CPP

Solve Questions