Question
/** @file Node.h Listing 4-1 */ #ifndef _NODE #define _NODE template class Node { private: ItemType item; // A data item Node * next; //
/** @file Node.h
Listing 4-1 */
#ifndef _NODE
#define _NODE
template
class Node
{
private:
ItemType item; // A data item
Node
public:
Node();
Node(const ItemType& anItem);
Node(const ItemType& anItem, Node
void setItem(const ItemType& anItem);
void setNext(Node
ItemType getItem() const ;
Node
};
The following will need to be modified:
- Node.h: add member variable Node* prev which points to previous node in linked list (or NULL for the first node in list)
- Node.h: add setPrev(), getPrev() prototypes, these are setter and getter functions for prev pointer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started