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
Get step-by-step solutions from verified subject matter experts
