#ifndef NODE_H #define NODE_H #include /** * This is a somewhat artificial class, designed specifically to * support the 'merge' assignment. It provides a node in a * doubly-linked list of integers, yet with the constructors * intentionally made private so that new nodes cannot be instantiated * (other than by friend class). */ class Node { public: const int element; Node* prev; Node* next; private: Node(int e = -1, Node* p = NULL, Node* n = NULL) : element(e), prev(p), next(n) { } // constructor friend class ListReader; // allow access to private member }; typedef Node* NodePtr; #endif