#include "AltLinkedDeque.h" #include #include using namespace std; int main() { cout << boolalpha; // causes booleans to be printed as true/false AltLinkedDeque data; cout << "size() should be 0: " << data.size() << endl; cout << "empty() should be true: " << data.empty() << endl; cout << "calling push_front('A')..." << endl; data.push_front('A'); cout << "size() should be 1: " << data.size() << endl; cout << "empty() should be false: " << data.empty() << endl; cout << "front() should be A: " << data.front() << endl; cout << "back() should be A: " << data.back() << endl; cout << "calling push_front('B')..." << endl; data.push_front('B'); cout << "size() should be 2: " << data.size() << endl; cout << "empty() should be false: " << data.empty() << endl; cout << "front() should be B: " << data.front() << endl; cout << "back() should be A: " << data.back() << endl; cout << "calling push_front('C')..." << endl; data.push_front('C'); cout << "size() should be 3: " << data.size() << endl; cout << "empty() should be false: " << data.empty() << endl; cout << "front() should be C: " << data.front() << endl; cout << "back() should be A: " << data.back() << endl; cout << "calling pop_back (to remove A)..." << endl; data.pop_back(); cout << "size() should be 2: " << data.size() << endl; cout << "empty() should be false: " << data.empty() << endl; cout << "front() should be C: " << data.front() << endl; cout << "back() should be B: " << data.back() << endl; cout << "calling pop_back (to remove B)..." << endl; data.pop_back(); cout << "size() should be 1: " << data.size() << endl; cout << "empty() should be false: " << data.empty() << endl; cout << "front() should be C: " << data.front() << endl; cout << "back() should be C: " << data.back() << endl; cout << "calling pop_back (to remove C)..." << endl; data.pop_back(); cout << "size() should be 0: " << data.size() << endl; cout << "empty() should be true: " << data.empty() << endl; cout << "calling push_front('D')..." << endl; data.push_front('D'); cout << "size() should be 1: " << data.size() << endl; cout << "empty() should be false: " << data.empty() << endl; cout << "front() should be D: " << data.front() << endl; cout << "back() should be D: " << data.back() << endl; }