// Assignment 2 Test program.
// File: exptree.cpp
// Written by MPIT at JCU
// Description:
// This program deals with a simple kind of expression tree where there are two kinds of nodes:
// (a) Leaf nodes, which contian a real number as their entry;
// (b) Noneleaf nodes, which contain one of '+','-','*','/' operators as their entry, and have exactly
two children.
//
//
// NON-MEMBER FUNCTIONS to maniplulate expression tree nodes:
// tempate <class Item>
// void infix(const exp_tree_node<Item>* node_ptr)
// Precondition: node_ptr is a pointer to a node in an expression tree (or
// node_ptr may be NULL to indicate the empty tree).
// Postcondition: If node_ptr is non-NULL, then the function f has been
// applied to the contents of *node_ptr and all of its descendants, using
// an in-order traversal.
//
// tempate <class Item>
// void prefix(const exp_tree_node<Item>* node_ptr)
// Precondition: node_ptr is a pointer to a node in an expression tree (or
// node_ptr may be NULL to indicate the empty tree).
// Postcondition: If node_ptr is non-NULL, then the function f has been
// applied to the contents of *node_ptr and all of its descendants, using
// an pre-order traversal.
//
// template <class Item>
// void postfix(const exp_tree_node<Item>* node_ptr)
// Precondition: node_ptr is a pointer to a node in an expression tree (or
// node_ptr may be NULL to indicate the empty tree).
// Postcondition: If node_ptr is non-NULL, then the function f has been
// applied to the contents of *node_ptr and all of its descendants, using
// an post-order traversal.
//
// template <class Item, class SizeType>
// void print(const exp__tree_node<Item>* node_ptr, SizeType depth)
// Precondition: node_ptr is a pointer to a node in an expression tree (or
// node_ptr may be NULL to indicate the empty tree). If the pointer is
// not NULL, then depth is the depth of the node pointed to by node_ptr.
// Postcondition: If node_ptr is non-NULL, then the contents of *node_ptr
// and all its descendants have been written to cout with the << operator,
// using a backward in-order traversal. Each node is indented four times
// its depth.