What would be the Prefix notation for the given equation? [code](a+(b/c)*(d^e)-f)[/code]

Kim Trang

New member
What would be the Prefix notation for the given equation?
Code:
(a+(b/c)*(d^e)-f)
A. -+a*/^bcdef
B. -+a*/bc^def
C. -+a*b/c^def
D. -a+*/bc^def
 
Answer: b
Explanation: Reverse the equation or scan the equation from right to left. Apply the infix-prefix algorithm. The preference order in ascending order are as follows +*/^. Brackets have the highest priority. The equations inside the brackets are solved first.
 

Tìm kiếm

Back
Top