Question: using namespace std; template struct BinaryNode T element; BinaryNodeleft; BinaryNode* right; BinaryNode (constT&dTO) element(d) leftnullptr; right - nullptr; //print the elements of binary tree in

 using namespace std; template struct BinaryNode T element; BinaryNodeleft; BinaryNode* right;BinaryNode (constT&dTO) element(d) leftnullptr; right - nullptr; //print the elements of binarytree in preorder template void preorder(const BinaryNode* root) if (root) cout element

using namespace std; template struct BinaryNode T element; BinaryNodeleft; BinaryNode* right; BinaryNode (constT&dTO) element(d) leftnullptr; right - nullptr; //print the elements of binary tree in preorder template void preorder(const BinaryNode* root) if (root) cout element '" preorder (root->left) preorder (root->right); //print the elements of binary tree in inorder template void inorder (const BinaryNodeleft) cout element '" inorder(root->right); //print the elements of binary tree in postorder template void postorder(const BinaryNodeleft); postorder (root->right); cout element '" . The main function is contained in the file lab06.cpp // lab06.cpp #include "funcs.cpp BinaryNode* create_binary_tree() Bina ryNodechar>* node-A = new Bina ryNode('B'); BinaryNode node_Cnew BinaryNode('C'); BinaryNode node_Dnew BinaryNode('D'); BinaryNodeleft - node B node A->right -node C; node B->left = node D node B->right -node E; return node A; int main) BinaryNode7 -26->5 -> 11 ->3 ->9 4 -> postorder: 2-5 ->11 -> 6-7 ->4 ->9-3->1

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!