Question: C++ - A function that adds a random node to a tree. Having a bit of trouble on creating this one function. For this function,

C++ - A function that adds a random node to a tree. Having a bit of trouble on creating this one function. For this function, a random place should be determined by starting at the root and for it to traverse down the tree left or right with a ~50% probability of either tree. When When you get to a point in the tree where the left or right has no child, insert the node.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!