edited by
1,062 views

2 Answers

0 votes
0 votes

Fully parenthesized expression: ((d/(e+f))+(b∗c))

Equivalent Postfix expression: def+/bc∗+

Replace ")" with the enclosed operator and remove the corresponding "(". Start with inner most expression.

Hence, option C is correct.

0 votes
0 votes
The steps are as follows:

$d/(e+f)+b*c$

$\implies ((d/(e+f))+(b*c))$

$\implies((d/ \ ef+))+(b*c))$

$\implies ((def+/)+(b*c))$

$\implies (def+/)+\ bc*$

$\implies def+/ \ bc* \ +$

Option $(C)$ is correct.

Note :1) Parenthesis $()$ is having the highest priority and associativity is left to right.

          2)  Division $(/)$, multiplication $(*)$ having less priority than parenthesis but high than addition $(+)$ operator. all of them having associativity is left to right.

          3) In infix expression operator is placed between operand while in postfix expression operator followed their operand.

Related questions

0 votes
0 votes
1 answer
1
go_editor asked Mar 27, 2020
566 views
When a function is recursively called, all automatic variables :are initialized during each execution of the functionare retained from the last executionare maintained in...
1 votes
1 votes
2 answers
2
go_editor asked Mar 27, 2020
6,323 views
What is the time required to insert an element in a stack with linked implementation ?$O (\log_2 n)$$O (n)$$O (n\log_2 n)$$O (1)$
0 votes
0 votes
1 answer
3
go_editor asked Mar 27, 2020
820 views
Which one of the following is a physical data structure ?ArrayLinked listsStacksTables
0 votes
0 votes
1 answer
4
go_editor asked Mar 27, 2020
1,519 views
Which of the regular expressions corresponds to this grammar ?$S → AB/AS, A → a/aA, B → b$$aa^*b^+$$aa^*b$$(ab)^*$$a(ab)^*$