Algebraic Expressions

An algebraic expression XYX \ast Y is represented as a binary tree with:

  • Root
    Operator \ast.
  • Left child
    XX.
  • Right child
    YY.

Unambiguous (unlike infix form without parentheses).

Forms

There are 3 common forms of algebraic expressions.

Infix Form

The symbol is written in-between the operands. The form we usually use.

Example: xyx*y

Prefix Form

Aka. Polish form. The symbol is written before the operands.

xyx*y’s prefix form is: xy* x y

Parentheses are not required. Start solving from right end.

Postfix Form

Aka. reverse Polish form. The symbol is written after the operands. Used commonly when parsing algebraic expressions in calculators.

xyx*y’s prefix form is: xyx y *

Start solving from left end.

Written by September 13, 2026 1 min read
Was this helpful?