Question: Implement a function TNode* copy_tree(TNode* t) that creates a copy of the tree t and returns a pointer to the root of the copy. Test
Implement a function TNode* copy_tree(TNode* t) that creates a copy of the tree t and returns a pointer to the root of the copy. Test this function by writing a main() that creates a tree and uses the function to create a copy. Change one tree and print both trees to verify they are different trees.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
