Binary tree
I have this problem to submit it tomorrow
I have to do it
pleeze help me
Add the implementation of the following functions to the class binaryTreeType:
1. nodeCount that takes as a parameter a pointer to the root node of a binary tree and returns the number of nodes in a binary tree.
2. leavesCount that takes as a parameter a pointer to the root node of a binary tree and returns the number of leaves in a binary tree.
3. swapSubTrees, that swaps all of the left and right sub trees of a binary tree.
4. singleParent that returns the number of nodes in a binary tree that have only one child.
Now write a main to test your functions, but first create a binary Search tree, to test the functions on.
Hint: notice that in the binaryTreeType class there are 2 versions for each function one that does not take parameters and the other one takes a pointer to the root as parameter, in the main you should call the one without parameters while in the recursive calls inside the class you have to call the one that takes parameter, in the same way you use the inorder and postorder functions
I will put my answer