1) When a tree is given like below select the proper traversal algorithm to evaluate the expression. Show why your selec
Posted: Sun May 15, 2022 8:11 am
1) When a tree is given like below select the proper traversal algorithm to evaluate the expression. Show why your selection is reasonable. + 6 4 + 8 2 3 2) Show how to change the basic data structure to get the evaluation results of the expression. Assume that the operators are limited to +, -, *, and /. The operands are limited to integer. typedef struct TreeNode *TreePointer; typedef struct TreeNode { int data; TreePointer leftchild, rightChild; } TreeNode; 3) Show how to change the traversal code to get the expression evaluation result. (Note: Refer to the postOrderEval() in the lecture note)