Write a C++ program that creates a random complete binary tree.
To pick a leaf at random, you should count the leaves. Then generate a random integer in the range 1 to the current number of leaves. And then go to te corresponding leaf.
Your code should prompt the user for the number of inserts, then generate a random tree, then output a representation of the tree, and the number of leaves.
use
struct Node
{
int leavesInSubtree;
Node *left, *right;
Node() {
leavesInSubtree=1; left = right = NULL;
}
};
Hello, sir. I will be happy to do this project for you. This project is very simple with me. Please hire me so i can start working now. Thank you so much for you attention. Have a good day.
Respected Sir
I am an electrical engineer and can currently doing research as a research assistance in high performance computing and networking lab in Al Khwarizmi institute of Computer science. I can do your job with quite ease.
Looking forward for great relation..
Regards`