Source of ListNode.h


  1: //  Created by Frank M. Carrano and Tim Henry.
  2: //  Copyright (c) 2013 __Pearson Education__. All rights reserved.

  4: // Interlude 5, pp 422.

  6: template<class ItemType>
  7: class ListNode           // A node on the list
  8: {
  9: private:
 10:    ItemType item;        // A data item on the list
 11:    Node<ItemType> *next; // Pointer to next node
 12:    Node();
 13:    Node(const ItemType& nodeItem, Node<ItemType>* nextNode);
 14:    
 15:    // Friend class - can access private parts
 16:    friend class LinkedList<ItemType>;
 17: }; // end ListNode