edited by
339 views

1 Answer

0 votes
0 votes
No, this [  ] will not get inside stack because this is only use to identify the precedence as inside bracket will perform first then outside by the way stack contain only operators and symbols(0 to 9,a to z,A to Z,etc)

Algorithm of infix to postfix work as:-

when any higher precedence operator come in compare to top of stack then push higher precedence operator in stack And if it is lesser than top of stack element then till it is lesser pop elements from stack and when it become higher precedence just push (higher precedence operator) into stack ...

this condition will run for left to right scanned input. If you give any improper symbol then algorithm will just ignore it and will scan next input symbol.
edited by

Related questions

0 votes
0 votes
0 answers
3
Mk Utkarsh asked Oct 20, 2018
824 views
Please convert it to postfix by using stack and explain in detailvoid (*bsd_signal(int sig, void (*func)(int)))(int);
0 votes
0 votes
0 answers
4
Radha mohan asked Dec 26, 2017
1,038 views
Sir it is given everywhere that time complexity of infix to postfix is O(1) but according to algorithm for some operators we have to traverse back the stack until we find...