form all posible expressions using. a. a and b
Answers
Answered by
0
Answer:here's ur answer
Step-by-step explanation:Find all possible outcomes of a given expression
Given an arithmetic expression, find all possible outcomes of this expression. Different outcomes are evaluated by putting brackets at different places.
We may assume that the numbers are single digit numbers in given expression.
Examples:
Input: 1+3*2
Output: 8 7
Explanation
(1 + 3)*2 = 80
(1 + (3 * 2)) = 70
Input: 1*2+3*4
Output: 14 20 14 20 20
(1*(2+(3*4))) = 14
(1*((2+3)*4)) = 20
((1*2)+(3*4)) = 14
((1*(2+3))*4) = 20
((1*2)+3)*4) = 20
Similar questions