Container Classes (data structures) -- e.g. Vec.h, vector -- store primitives (int, double) and objects vector> v; ^ | | WRONG: this is the >> operator fix | | v vector< vector > v; -- decision: which container class should we use? --- what are the most frequent operations we'll need? -- iterators -- identifies a container and a specific element within the container -- we can examine, change the value stored at that element in the container (can't change const iterator...) -- move the iterator forward (and maybe backward, too) ++ -- -- restrict the available operations based on the container vector: ----------------------------- v ---> | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ----------------------------- erase(2) O(n) ----------------------------- v ---> | 1 | 3 | 4 | 5 | 6 | 7 | | ----------------------------- operator[] O(1) v[4] ===> *(v+4) list (linked list): ----- l ---> | 1 | ----- | x----->| 2 | ----- ----- | x------->| 3 | ----- | x--->/// ----- erase(2) O(1) operator[] O(n) -- this is not available WRITE SOME CODE: ---------------- (1) Use templated class Node: template class Node { public: T value; // e.g. int Node* next; // pointer to the next // element in the list Node* prev; }; (2) Write code to perform: push_back() push_front() pop_back() pop_front() erase()