Draw an arithmetic expression tree that has four external nodes, storing the numbers 1, 5, 6, and 7 (with each number stored in a distinct external node, but not necessarily in this order), and has three internal nodes, each storing an operator from the set {+,−,∗,/}, so that the value of the root is 21. The operators may return and act on fractions, and an operator may be used more than once
The following arithmetic expression tree that has four external nodes, storing the numbers 1, 5, 6, and 7 (with each number stored in a distinct external node, but not necessarily in this order), and has three internal nodes, each storing an operator from the set {+,−,∗,/}, so that the value of the root is 21:
*
/ \
+ 7
/ \
/ \
1 -
/ \
/ \
5 6
In this expression tree: