Evaluate the following prefix expression " ++ 26 + - 1324"

Answers were Sorted based on User's Feedback



Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / a khan

I am new to this but i will try like this
This looks tricky.... i may not be right. There might be on
+/- missing in the original expression but if it is not
then...

+8+-224
+8+04
+84
12

Is This Answer Correct ?    22 Yes 22 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / bipin from utkal university mc

here one operator id missing

Is This Answer Correct ?    1 Yes 1 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / narayan kunal

for evaluating the prefix expression first reverse the
prefix expression then sole like postfix expression
the reverse of given expression is
4231-+62++
then push 4,2,3,1 to stack ,now pop last two elements and
1-3=-2
now again push -2 to stack,now the element of stack is 4,2
,-2 again pop last two elements and do
-2+2=0
we know that if zero comes like symbol then we directly pop
this and proceed to next step
now the content of stack is 4 lets go to the next step
push 6 and 2 to the stack so now content of stack is 4,6,2
now
pop last two elements
6+2=8
push 8 to stack
content of stack is 4,8
again remove last two elements of elements and do
4+8=12
now all operator and operand ends up
so final answer is 12

Is This Answer Correct ?    2 Yes 2 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / varun

(2+6)+((13-2)+4)=23
this is the correct answer...

Is This Answer Correct ?    0 Yes 0 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / pallab datta

One operator is missing in this expression. There are six operands ( 2, 6, 1, 3, 2, 4 ) and four operators ( + , + , + , - ). The number of operators must be exactly 1 less than the number of operands to be a proper expression. Here the number of operator is 2 less than the number of operands. Hence evaluation of this expression is not possible.

Is This Answer Correct ?    0 Yes 0 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / sayali

423162-++

Is This Answer Correct ?    2 Yes 3 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / majeed

++26+-1324
=+(2+6)+(1-3)24
=(2+6)+(1-3)+(24)
=8+(-2)+24
=8-2+24
=6+24
30
++26+-1324
=+(2+6)+(13-24)
=8-11
=-3

Is This Answer Correct ?    0 Yes 1 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / vivek

take a stack and push operators into stack such as (*,+,_,/,etc) and when 2 operands(let a & B) appears pop out 1 operator and perform the expression (a operator B) and push it in 2 a stack



eg: ++2 6+-13 2 4
+(2+6) +-13 2 4
+8+(13-2)4
+8+11 4
+8(11+4)
+8 15
8+15
23 ans

Is This Answer Correct ?    0 Yes 1 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / ravi shikharhcu

If operator is not missing then answer of uma shankar is
correct.

Is This Answer Correct ?    6 Yes 9 No

Evaluate the following prefix expression " ++ 26 + - 1324"..

Answer / naman

there are 4 operators and 6 operands. how can this be a
correct prefix exp ? ans1 and 2 are correct with there
assumptions..

Is This Answer Correct ?    6 Yes 9 No

Post New Answer

More Data Structures Interview Questions

Can we change load factor of hashmap?

0 Answers  


What is time complexity of bubble sort?

0 Answers  


Define 2-3 tree?

0 Answers  


How does arraylist size work?

0 Answers  


Why do we use trees in data structures?

0 Answers  






Is hashmap fail safe?

0 Answers  


Does treeset allow duplicates?

0 Answers  


What is a circular singly linked list?

0 Answers  


Can hashtable have duplicate values?

0 Answers  


What do you mean by external sorting?

0 Answers  


How to excel in data structures and algorithms?

0 Answers  


Which sorting is best and why?

0 Answers  


Categories