edited by
19,816 views

7 Answers

Best answer
70 70 votes
We have to keep symbol into stack and when we get two operands followed by operator. We will apply operator on last two operands.$$\begin{array}{|ll|}\hline \textbf{symbol}  &  \textbf{stack } \\\hline \text{10} & \text{10 $\quad$ (keep in stack)}\\\hline \text{5} & \text{10 $\quad$ 5 $\quad$ (keep in stack)}\\\hline
\text{+} & \text{10 $\quad$ 5 $\quad$ + $\quad$ (apply operator on last 2 operands $\implies 10+5=15)$}\\\hline \text{60} & \text{15 $\quad$ 60 $\quad$ (keep in stack)}\\\hline  \text{6} & \text{15 $\quad$ 60 $\quad$ 6 $\quad$ (keep in stack)}\\\hline  
\text{/} & \text{15 $\quad$ 60 $\quad$ 6 $\quad$ / $\quad$ (apply operator on last 2 operands $\implies 60/6=10)$}\\\hline  
\text{*} & \text{15 $\quad$ 10 $\quad$ * $\quad$ (apply operator on last 2 operands $\implies  10*15=150)$}\\\hline   \text{8} & \text{150 $\quad$ 8 $\quad$ (keep in stack)}\\\hline   - & \text{150 $\quad$ 8 $\quad -\quad$ (apply operator on last 2 operands $\implies 50-8=142)$}\\\hline  \end{array}$$

So, answer is $142$.
edited by
7 7 votes

10 5 + 60 6 / * 8 -

Operation  Symbol Stack
  10 5 + 60 6 / * 8 - NULL
Push 5 + 60 6 / * 8 -   10
Push         + 60 6 / * 8 -   10 5
Pop 60 6 / * 8 - (10 + 5)
Push 6 / * 8 - (10 + 5) 60
Push / * 8 - (10 + 5) 60 6
Pop * 8 - (10 + 5) (60/6)
Pop 8- (10 + 5) * (60/6)
Push - [(10 + 5) * (60/6)]  8
Pop Null [(10 + 5) * (60/6)]  - 8

So after evaluation of    [(10 + 5) * (60/6)]  - 8 = 142 so option c is answer

3 3 votes

This postfix expression can be evaluated using stack..

                                6

           5            60   60  10            8

    10  10    15  15   15  15   150   150     142

    10    5    +    60    6     /     *        8         -

Answer will be 142.

Answer:
Position:
Show:

Related questions

39 39 votes
4 answers 4 answers
15.4k
15.4k views
go_editor asked Feb 14, 2015
15,382 views
Consider the following array of elements.$\langle 89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100 \rangle$The minimum number of interchanges needed to convert it into a ma...
49 49 votes
5 answers 5 answers
14.9k
14.9k views
go_editor asked Feb 14, 2015
14,889 views
Given that hash table $T$ with $25$ slots that stores $2000$ elements, the load factor $a$ for $T$ is _________.
34 34 votes
8 answers 8 answers
12.7k
12.7k views
go_editor asked Feb 14, 2015
12,676 views
While inserting the elements $71, 65, 84, 69, 67, 83$ in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is$65$$67$$69$$83$
52 52 votes
4 answers 4 answers
17.8k
17.8k views
go_editor asked Feb 12, 2015
17,834 views
Consider the C program below#include <stdio.h int *A, stkTop; int stkFunc (int opcode, int val) { static int size=0, stkTop=0; switch (opcode) { case -1: size = val; brea...