3 3 votes There is given a infix expression: ${\color{Red} {1}}$ $A+B\times C/\left ( \left ( D+E \right )+F\times G \right )$ While converting infix expression to postfix expression number of symbols in the stack at indicated ${\color{Red} {point-1}}$ infix expression (assume stack is initially empty) ______________ they told $5$, but is it correct? Can anyone give some explanation?? Data Structures made-easy-test-series data-structures stack + – srestha 2.0k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote Yes it is 5 Devg123 answered May 8, 2019 Devg123 comment Share Follow See all 4 Comments 4 4 Comments reply srestha commented May 8, 2019 reply Follow flag how?? 0 0 replyShare pranay91331 commented May 31, 2019 reply Follow flag Can you give the explanation please. 0 0 replyShare Hira Thakur commented Aug 1, 2019 reply Follow flag I got ABC*DE+FG*+/+ as postfix expression with stack size 6, please verify it. 0 0 replyShare Himanshu Kumar Gupta commented Aug 23, 2020 reply Follow flag i got 5 0 0 replyShare Please log in or register to add a comment.
0 0 votes 5 is right abhishekmehta4u answered May 31, 2019 abhishekmehta4u comment Share Follow See all 2 Comments 2 2 Comments reply Gupta g commented Sep 17, 2019 reply Follow flag I think it will be ABCxDE+FGx+/+ 5 5 replyShare ani0135 commented Jul 10, 2022 reply Follow flag Please read the question. It clearly says that we have to do pop and push operation in operator stack till "Point 1" only. It means for last operator ")" we don't have to do the operation. 0 0 replyShare Please log in or register to add a comment.
0 0 votes Answer should be 6. The symbol ‘(‘ can never be popped from the stack whatever may be the precedence level of scanned character. If the character is closing round bracket ( ')' ), pop out operators from operator's stack until we find an opening bracket ('(' ) . Due to this reason, the operator stack will contain +/((+*. If you count this, these operators total to 6 & hence the answer. DAWID15 answered Sep 13, 2022 DAWID15 comment Share Follow 0 reply Please log in or register to add a comment.