Implement the recursive function "CountNodes" of a binary tree. struct TreeNode { ItemType
info; TreeNode* left; TreeNode* right; }; int CountNodes(TreeNode* tree); // Prototype int
TreeType::GetLength() const // Class member function return CountNodes(root); } int
CountNodes(TreeNode* tree) // Recursive function that counts the nodes { // Add your code
here

Implement the recursive function CountNodes of a binary tree. struc.pdf

  • 1.
    Implement the recursivefunction "CountNodes" of a binary tree. struct TreeNode { ItemType info; TreeNode* left; TreeNode* right; }; int CountNodes(TreeNode* tree); // Prototype int TreeType::GetLength() const // Class member function return CountNodes(root); } int CountNodes(TreeNode* tree) // Recursive function that counts the nodes { // Add your code here