1,022 views
1 votes
1 votes
The infix form of the following postfix form ‘P’
will be
P: 3 , 5 , 7 , – , 10 , + , 4 , / , /
(a) 3 / 5 – 7 + 10 / 4 (b) (((3 + 5) – (7 / 10 ))/ 4)
(c) (3 / (((5 – 7) + 10) / 4)) (d) 3 + 5 – 7 / 10 / 4

4 Answers

2 votes
2 votes
option C is correct because

( 3 / ( ( ( 5 - 7 ) + 10 ) / 4 ) )

based on priority(postfix to infix)....

1. (5-7)

2. ((5-7)+10)

3. (((5-7)+10)/4)

4. ( 3 / ( ( ( 5 - 7 ) + 10 ) / 4 ) )

and finally answer is    3 5 7 - 10 + 4 / /  which is match with "P" Statement.
edited by
2 votes
2 votes

Run a Stack Operation :   

P :  3  ,5 , 7, - 10, + ,4 , / , /

3, 5, 7, –, 10, + , 4 , / , /

3 , (5 – 7) , 10 , + , 4 , / , /

3 , ((5 – 7)+ 10), 4 , / , /

3 , (((5 – 7)+ 10)/4) , /

(3 / (((5 – 7) + 10) / 4))

1 votes
1 votes
C Answer

3 , 5 , 7 , – , 10 , + , 4 , / , /

3 , (5 – 7) , 10 , + , 4 , / , /

3 , ((5 – 7)  + 10)  , 4 , / , /

3 , (((5 – 7)  + 10)/4) , /

(3 / (((5 – 7) + 10) / 4))

Related questions

0 votes
0 votes
0 answers
1
Mk Utkarsh asked Oct 20, 2018
828 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
2
Radha mohan asked Dec 26, 2017
1,040 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...
2 votes
2 votes
1 answer
3
sumit goyal 1 asked Jul 31, 2017
341 views
if i get A + [ (B+C) ] /G in infix and i want to convert it into postfix then what to do with sign [ should i push it into stack ??