// https://www.geeksforgeeks.org/set-in-cpp-stl/ // Things to discuss // How to l = l + 4 // How to l = 4 + l; // How to l = l - 4; // How to l = 4 - l; // WHat the heck is l < 4 // Remember l might be null // Due: Friday before finals week #include #include using namespace std; ostream &operator<<(ostream &os, set&s) { for (auto itr = s.begin(); itr != s.end(); itr++) { cout << *itr << " "; } return os; } void compare(set &s1, LinkedList &l1) { cout << "These should be the same" << endl; cout << s1 << endl; cout << l1 << endl; } int main() { cout << "==========\n\n\n\n\n\n\n" << endl; set s; LinkedList l; s.insert(3); l = l + 3; compare(s, l); s.insert(13); l = 13 + l; compare(s, l); s.insert(1); s.insert(2); s.insert(3); s.insert(4); l = l + 1 + 2 + 3 + 4; compare(s, l); s.erase(4); l = l - 4; compare(s, l); s.erase(1); l = l - 1; compare(s, l); s.erase(9999); LinkedList l2 = l - 9999; compare(s, l); if (l < 14) cout << "Good. L has nothing greater than 14\n"; else cout << "Bad answer\n"; if (l < 1) cout << "Bad answer\n"; else cout << "Good. L does have something greater than 1\n"; }