Data Structures & AlgorithmsModerateInfosys · Data Structures

What is the postfix form of the infix expression a + b * c - d / e?

  1. A. ab+c*de/-
  2. B. abc*+d-e/
  3. C. abcde/*-+
  4. D. abc*+de/-

Correct answer: D. abc*+de/-

* and / bind tighter than + and -; the left-associative + and - are applied in order: (a + (b*c)) - (d/e).

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

Exams that ask this topic