Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help please! i need this in codeblocks c++ Add these three functions to the clas

ID: 3682383 • Letter: H

Question

Help please! i need this in codeblocks c++

Add these three functions to the class binaryTreeType (provided).

Write the definition of the function, nodeCount, that returns the number of nodes in the binary tree.

Write the definition of the function, 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.

Write a function, swapSubtrees, that swaps all of the left and right subtrees of a binary tree. Print the original tree and the resulting tree using a pre-order traversal.

Write a program to test your new functions. Use the data provided to build your binary search tree (-999 is the sentinel):

Data: 65 55 22 44 61 19 90 10 78 52 -999

Explanation / Answer

what do you mean by code blocks c++. In c++ , keep where ever if you want to scan a element keep cin<<" ">>; and if you wanto get the output keep cout<<" ">>. Its easy once try it .