1) When a tree is given like below select the proper traversal algorithm to evaluate the expression. Show why your selec
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
1) When a tree is given like below select the proper traversal algorithm to evaluate the expression. Show why your selec
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)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!