Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. Assume that the operators +, –, ×, are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^, ×, +, –. The postfix expression corresponding to the infix expression a + b × c – d ^ e ^ f is
    1. abc × + def ^^–
    2. abc × + de^f^–
    3. ab + c × d – e^f^
    4. – + a × bc ^^ def
Correct Option: A

a + b × c – d ^ e ^ f
a + b × c – d ^ e f ^
a + b × c – d e f ^ ^
a + b c × – d e f ^ ^
a b c × – d e f ^ ^
a b c × + d e f ^ ^
a b c × + d e f ^ ^–
the result is obtained.



Your comments will be displayed only after manual approval.