Question: Translate this C++ code into to C. #include #include #include #include using namespace std; class BinaryTreeNode { public: char data; BinaryTreeNode *left, * right; BinaryTreeNode(char

Translate this C++ code into to C.

#include

#include #include #include using namespace std;

class BinaryTreeNode { public: char data; BinaryTreeNode *left, * right; BinaryTreeNode(char data) { this->data = data; this->left = this->right = NULL; } };

bool find_it(char val) { if (val == '+' || val =='-' || val == '*' || val =='/') return true; else return false; }

void inorder(BinaryTreeNode *tree) { if(tree!= NULL) { inorder(tree->left); cout<data; inorder(tree->right); } }

void postorder(BinaryTreeNode * tree) { if (tree != NULL) { postorder(tree->left); postorder(tree->right); cout<data; } }

void preorder(BinaryTreeNode *tree) { if (tree!= NULL) { cout<data; preorder(tree->left); preorder(tree->right); } } BinaryTreeNode * create_expression(string pf) { stack st; int i=0; BinaryTreeNode * ptr_1, *ptr_2; int sz = pf.length(); for(i=0;ileft = ptr_2; node_opr->right = ptr_1; st.push(node_opr); } } return (st.top()); }

int main() { string pf; cout<<"Enter the postfix expression"<>pf; BinaryTreeNode * root = create_expression(pf); cout<<" Inorder traversal"<

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!