3,038 views
0 0 votes
Evaluate the given prefix expression,And find the result the of the expression?
Say +-*+ABCD*AB ,Where A=4,B=3,C=2,D=5.

Answer is 3 or 21??

1 Answer

0 0 votes

Answer is 21.

+-*+ABCD*AB after converting in infix expression = (A+B)*C-D+A*B

After putting A = 4,B = 3,C = 2,D = 5 in the infix expression

(4+3)*2-5+4*3 = 7*2-5+12 = 14-5+12 = 9+12 = 21

Position:
Show:

Related questions

–1 –1 vote
0 0 answers
796
796 views
himgta asked Sep 12, 2018
796 views
0 0 votes
0 0 answers
644
644 views
himgta asked Sep 11, 2018
644 views
We want to perform reversal of a stack, which mean reversing the contents of the stack and placing it on the same stack. For example if Stack S contains 1 2 3, where 1 be...
0 0 votes
1 answers 1 answer
711
711 views
himgta asked Sep 11, 2018
711 views
Which of the following is/are true?I. The maximum number of nodes in a complete binary tree of height h is 2h+1-1.(Assume root is at height 0) II. Given the in-order, pos...
0 0 votes
0 0 answers
526
526 views
himgta asked Apr 13, 2018
526 views
The number of binary search tree’s with 4 nodes (1, 2, 3, 4) possible where in every binary search tree ‘1’ is leaf node are .....How to solve such type of questions in t...