2,810 views
3 votes
3 votes
consider the following infix expression which is to be converted to postfix expression using stack.

(((P+Q)*(R+S))/T)+(A*(B+C))

The sum of all unique possible heights of stack when converting infix to postfix is______

ans given:15

but i am getting 19.is this correct?

3 Answers

–1 votes
–1 votes
Height of stack = 5

here we are using operator stack to convert infix to postfix while converting infix to postfix operands order can not chang but operators order may chang

postfix expresion=PQ+RS+*T/ABC+*+
edited by
Answer:

Related questions

10 votes
10 votes
3 answers
3
Arjun asked Feb 18, 2021
8,375 views
Consider the following sequence of operations on an empty stack.$$\textsf{push}(54);\textsf{push}(52);\textsf{pop}();\textsf{push}(55);\textsf{push}(62);\textsf{s}=\texts...