Question: Add both preorder and post-order functions to Chp4_Postfix_Infix.cpp then test new functions C++ code is below: #include using namespace std; struct n { char d;
Add both preorder and post-order functions to Chp4_Postfix_Infix.cpp then test new functions
C++ code is below:
#include
} void inOrder(n *tree) { if (tree != NULL) { inOrder(tree->l); cout << tree->d; inOrder(tree->r); } } int main(int argc, char **argv) { cout << "Enter Postfix Expression like 762*+6+ : "; cin >> pf; construct_expression_tree(pf); cout << " In-Order Traversal : "; inOrder(a[0]); cout << endl; return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
