Follow these steps to create the binary tree:
- Create a node with the following structure: data for storing tree elements, a right pointer to point at the right child of the tree, and a left pointer to point at the left child of the tree.
- Create the root node of the tree. To do this, allocate memory space for a new node and set the root pointer to point at it.
- Prompt the user to enter the tree elements. The value that's entered by the user is assigned to the data member of the root node.
- The left and right pointers of the root node are set to NULL.
- The root node is created. Next, prompt the user to specify the number of elements in the tree.
- Repeat steps 7 to 22 for the number of elements specified by the user. ...