As stack application, the following algorithm ilustrates how postfix is converte
ID: 3905964 • Letter: A
Question
As stack application, the following algorithm ilustrates how postfix is converted into infix 1. Scan expression E from left to right character by character ch = get-next-token(E) 2, while(ch ! # ) do if(ch operand) then push(ch) if(ch = operator) then begin t2 pop() and t1 pop) push(concatenate [t1, ch, t21) end ch = get-next-token(E) end while 3, if ch-,#, while(lemptystack()) pop and display 4. stop Convert the following postfix expression to its infix form as the final product processed by the previous algorithm. WRITE YOUR ANSWER WITHOUT SPACE Answer:Explanation / Answer
Answer:
A x B ^ C which means (A x B)^C
Explanation : A , B pushed into Stack as they are Operand
Then we get x , which is Operator so A x B
Then C added into Stack, then ^ ...Now the Stack will be A x B ^ C and its the final Answer
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.