The code is as follows:
/*5. Set & Multiset*/ Set<string>cities{"Braunschweig","Hanover","Frankfurt","New York", "Chicago","Toronto","Paris","Frankfurt" }; Multiset<string>dup_cities {"Braunschweig","Hanover","Frankfurt","New York", "Chicago","Toronto","Paris","Frankfurt" }; cout<<"Cities before:"<<Endl; Containerutil<Set<string>>::p rintelements (cities); Containerutil<multiset<string>>::p rintelements (dup_cities); Cities.insert ({"London","Munich","Hanover","Braunschweig" }); Dup_cities.insert ({"London","Munich","Hanover","Braunschweig" }); cout<<"Cities after:"<<Endl; Containerutil<Set<string>>::p rintelements (cities); Containerutil<multiset<string>>::p rintelements (dup_cities);
Operation Result:
Cities before:
Braunschweig Chicago Frankfurt Hanover New York Paris Toronto
Braunschweig Chicago Frankfurt Frankfurt Hanover New York Paris Toronto
Cities after:
Braunschweig Chicago Frankfurt Hanover London Munich New York Paris Toronto
Braunschweig Braunschweig Chicago Frankfurt Frankfurt Hanover Hanover London Munich New York Paris Toronto
STL-Common associative container code-set & Multiset