Data Structures & AlgorithmsModerateWipro · Accenture pattern

What is the postfix form of (A + B) * C − (D − E) * (F + G)?

  1. A. A B C + * D E − F G + * −
  2. B. A B + C * D E − − F G + *
  3. C. A B + C * D E − F G + * −
  4. D. A B + C D E − * F G + * −

Correct answer: C. A B + C * D E − F G + * −

Left operand of the main −: (A + B) * C → A B + C *. Right operand: (D − E) * (F + G) → D E − F G + *. Then the − goes last.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic