Question: IntList ( ) : Initializes an empty list. void push _ front ( int value ) : Inserts a data value ( within a new

IntList(): Initializes an empty list.
void push_front(int value): Inserts a data value (within a new node) at the front end of the list.
bool empty() const: Returns true if the list does not store any data values (does not have any nodes), otherwise returns false.
const int & front() const: Returns a reference to the first value in the list. Calling this on an empty list causes undefined behavior.
const int & back() const: Returns a reference to the last value in the list. Calling this on an empty list causes undefined behavior.
void pop_front(): Removes the value (actually removes the node that contains the value) at the front end of the list. Does nothing if the list is already empty.
void clear(): Removes (deallocates) all IntNodes in the IntList. Don't forget to set both head and tail to appropriate values for an empty list. DO NOT leave them dangling!
~IntList(): Deallocates all remaining dynamically allocated memory (all remaining IntNodes). Once the clear function is working, this destructor just needs to call the clear function.
Global (non-member) Friend Function
friend ostream & operator<<(ostream &, const IntList &): Overloads the insertion operator (<<) so that it sends to the output stream (ostream) in a single line all of the int values stored in the list, each separated by a space. This function does NOT send a newline or space at the end of the line.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!