34 34 votes The result evaluating the postfix expression $10 \ 5 + 60 \ 6 / * 8 -$ is $284$$213$$142$$71$ Data Structures gatecse-2015-set3 data-structures stack easy + – go_editor 19.8k views answer comment Share Follow Print See 1 comment 1 1 comment reply Saurabh_tripathi commented Jan 22 reply Follow flag (((10+5)*(60/6))-8) ((15*10)-8) 150-8 142 0 0 replyShare Please log in or register to add a comment.
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$. Praveen Saini answered Feb 20, 2015 • edited Jun 29, 2019 by Pooja Khatri Praveen Saini comment Share Follow See all 2 Comments 2 2 Comments reply `JEET commented Dec 19, 2019 reply Follow flag This is just a woww explanation. Read it once and you are just done, 6 6 replyShare One_Last_Hope commented Oct 29, 2025 reply Follow flag Yeah this solution is Insane Read once solve many. Fuking brutal solution this is 0 0 replyShare Please log in or register to add a comment.
20 20 votes (10 + 5) * (60 / 6) - 8 = 15 * 10 - 8 = 142 Arjun answered Feb 14, 2015 Arjun comment Share Follow 0 reply Please log in or register to add a comment.
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 Rishi yadav answered Oct 3, 2017 Rishi yadav comment Share Follow 0 reply Please log in or register to add a comment.
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. rpdhakad answered Jul 13, 2015 rpdhakad comment Share Follow 0 reply Please log in or register to add a comment.
2 2 votes 150-8 = 142 Asim Siddiqui 4 answered Nov 26, 2018 Asim Siddiqui 4 comment Share Follow 0 reply Please log in or register to add a comment.
2 2 votes Colors speak more :p Answer is 142 ie. (C) KathanVakharia answered Jan 10, 2022 KathanVakharia comment Share Follow 0 reply Please log in or register to add a comment.