1 #include <iostream>
2 #include <string>
3 #include "MySet.h"
4 using namespace std;
5
6 int main()
7 {
8
9 MySet<string> set;
10 set.add("Smith");
11 set.add("Anderson");
12 set.add("Lewis");
13 set.add("Cook");
14 set.add("Smith");
15
16 cout << "Keys in set: " << set.toString() << endl;
17 cout << "Number of keys in set: " << set.getSize() << endl;
18 cout << "Is Smith in set? " << set.contains("Smith") << endl;
19
20 set.remove("Smith");
21 cout << "Names in set are ";
22 for (string s: set.getKeys())
23 cout << s << " ";
24
25 set.clear();
26 cout << "\nKeys in set: " << set.toString() << endl;
27
28 return 0;
29 }