Question: In C++ implement a ternary tree abstract data type (ADT') that uses dynamic memory allocation. Make it a tree of integers. Each node will have

In C++ implement a ternary tree abstract data type (ADT') that uses dynamic memory allocation. Make it a tree of integers. Each node will have between 0 and 3 children (left, middle, right). Along with the class definition(s), you must implement the following methods for the class ternary: Default constructor Destructor must be recursive or use a recursive method to delete all the nodes in a tree. Copy-constructor - must be recursive or use a recursive method make an complete copy of a tree. Preorder - which prints out the entire tree using a preorder traversal. Must be recursive. Postorder which prints out the entire tree using a postorder traversal. Must be recursive
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
