Practice Question (Gate 1995)
Duration: 4 min
This video lesson is available to enrolled students.
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This lecture solves a GATE 1995 multiple-choice question asking for the postfix expression of A+B*(C+D)/F+D*E. The instructor writes the infix expression on a whiteboard and converts it step by step, beginning with the innermost parentheses. The subexpression (C+D) is replaced by its postfix form CD+, underlining the operator to track conversion order. The multiplication B*(CD+) is then grouped as BCD+*, and division by F gives BCD+*F/. The remaining addition A + ... and the final D*E term are processed to produce the complete postfix string ABCD+*F/+DE*+. The final answer is underlined at the bottom of the board and matches option (b). The method emphasizes operator precedence, associativity, and incremental replacement of subexpressions with their postfix equivalents.
Chapters
0:00 – 2:00 00:00-02:00
The video opens with the GATE 1995 question: 'The postfix expression for the infix expression A+B*(C+D)/F+D*E is:' with four options. The instructor writes the full infix expression on the whiteboard, then begins conversion by underlining the + inside (C+D) and rewriting it as CD+. The expression becomes A+B*CD+/F+D*E, showing the first precedence-based simplification.
2:00 – 3:38 02:00-03:38
The instructor continues the conversion, grouping B*CD+ as BCD+*, then applying division by F to form BCD+*F/. The remaining A + ... and D*E parts are processed, yielding the final postfix string ABCD+*F/+DE*+, which is underlined at the bottom of the board. This matches option (b), ABCD+*F/DE*++.
The core teaching point is the systematic infix-to-postfix conversion rule: process parentheses first, then apply operator precedence and associativity, replacing each subexpression with its postfix equivalent. The worked example demonstrates that (C+D) becomes CD+, B*(CD+) becomes BCD+*, and the full expression resolves to ABCD+*F/+DE*+. The underlining technique helps students track which operators have been moved. This method is directly applicable to similar GATE questions involving nested parentheses and mixed precedence.