Source of Listing16-1.h


  1: //  Created by Frank M. Carrano and Timothy M. Henry.
  2: //  Copyright (c) 2017 Pearson Education, Hoboken, New Jersey.

  4: // Listing 16-1.

  6: template<class ItemType>
  7: class TreeNode
  8: {   
  9: private:
 10:    ItemType item;        // Data portion
 11:    int      leftChild;   // Index to left child
 12:    int      rightChild;  // Index to right child

 14: public:
 15:    TreeNode();
 16:    TreeNode(const ItemType& nodeItem, int left, int right);
 17:    
 18:    // Declarations of the methods setItem, getItem, setLeft, getLeft,
 19:    // setRight, and getRight are here.
 20: }; // end TreeNode