Write a menu-driven program that will perform the following operations on a binary tree. Use the declarations shown. All pre-conditions assume that the parameter tree is initialized but may be empty or just contain one (root) node.
int countreeNodes(TreeNode tree)
// post: returns the number of nodes in the tree
int countLeaves(TreeNode tree)
// post: returns the number of leaves (non-parents)
// in the tree
int height(TreeNode tree)
// post: returns the height of the tree; 0 if empty,
// 1 if only one node
void interchange(TreeNode tree)
// post: swaps all the left subtrees with all the right
// subtrees of the tree
Boolean isAncestor(TreeNode tree, int p, int c)
// post: returns true if the node containing p is an
// ancestor of another node containing c
// otherwise returns false
void printLevel(TreeNode tree, int level)
// post: displays the information stored in each node of
// the tree at a given level >= 0