Question: 2. For the arithmetic expressions below, draw a binary tree that represents the expression, and then use tree traversals to find the equivalent prefix and
2. For the arithmetic expressions below, draw a binary tree that represents the expression, and then use tree traversals to find the equivalent prefix and postfix expressions.
a. (A-B)-C b. A/ (B-(C-(D-(E-F)))) c. ((A*(B+C))/(D-(E+F)))*(G/(H/(I*J)))
3. Construct the Huffman code for the Java keyword and weights given in the following table. Each keyword is considered as a single unit.
| Words | Weight |
| int | 0.30 |
| main | 0.30 |
| while | 0.05 |
| if | 0.20 |
| for | 0.15 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
