What is the postfix form of A ^ B ^ C, where ^ is exponentiation and is right-associative?
Correct answer B. A B C ^ ^
Explanation
Exponentiation groups from the right, so A ^ B ^ C means A ^ (B ^ C). B ^ C becomes B C ^, and raising A to that result gives A B C ^ ^. The tempting A B ^ C ^ corresponds to (A ^ B) ^ C, which is a different value. In the shunting-yard algorithm, an incoming ^ does not pop another ^ from the stack for this reason.
Answer checked How we write and check questions
Discussion