#include
#include
#include
using namespace std;
class List;
class Iterator;
class Node
{
public:
/*
Constructs a node with a given data value.
@param s the data to store in this node
*/
Node(string s);
private:
string data;
Node* previous;
Node* next;
friend class List;
friend class Iterator;
};
class List
{
public:
/**
Constructs an empty list;
*/
List();
/**
Appends an element to the list.
@param s the value to append
*/
void push_back(string s);
/**
Inserts an element into the list.
@param iter the position before which to insert
@param s the value to append
*/
void insert(Iterator iter, string s);
/**
Removes an element from the list.
@param i the position to remove
@return an iterator pointing to the element after the
erased element
*/
Iterator erase(Iterator i);
/**
Gets the beginning......
Join Now or Login to view the rest of this paper.
Approximate Word Count: 956
Approximate Pages: 4 (260 words per double-spaced page) |