| Note: it is possible (perhaps even probable) that we will find some ambiguities or omissions in the project specifications. If this should occur, corrections will be posted as soon as possible and a note will be placed here outlining the changes. Please check back periodically for updates. |
data(); // default constructor
~data(); // default destructor
void print(); // display the data item
void fill(); // fill the data item from user input
You will also be required to provide a copy constructor for the data class and to
overload the assignment operator for the data class (simply using the default versions
is not considered to meet this requirement).
private:
struct lnode {
data* d; // application data to be stored for the node
lnode* after; // ptr to neighbouring node closer to the front
lnode* before; // ptr to neighbouring node closer to the back
};
lnode* front;
lnode* back;
lnode* current;
public:
datalist(); // default constructor (empty list)
~datalist(); // default destructor (deletes all lnodes)
void jumpFront(); // sets current to point to front
void jumpBack(); // sets current to point to front
void stepFwd(); // steps current one node toward back (no effect if already at back)
void stepBack(); // steps current one node toward front (no effect if already at front)
void replace(data *d); // replaces current node's data with d
// (has no effect if current or d is null)
void display(); // displays data content of current node
void insert(data *d); // inserts new node at back (no effect if d is null,
// sets current if the list was previously empty)
data* remove(); // removes and deletes front node, returns its data pointer
// (simply returns nullptr if list was already empty,
// nullifies current if resulting list is empty)
You are free to add additional fields and methods to the class, but the
core set listed here should be implemented as specified.
ssh -x csci fork csci161/project csci161/$USER/project git clone csci:csci161/$USER/projectTo compile/run the project:
make projectx ./projectxTo submit the project:
git add filename < - - for each of the .h/.cpp files you modify and the readme git commit -m "some message" git push