/Infix-to-Postfix

C++ program to validate an infix expression, convert it into postfix expression and then evaluate it.

Primary LanguageC++

Infix to Postfix Conversion

Working

  • Takes an infix from the user in the form of a string
  • Checks if it is a valid infix expression
  • Converts the infix to postfix and displays the results
  • Evaluates the infix and displays the results

Valid Expression

A given infix expression is valid if:

  • it is not an empty string
  • it contains only digits (0-9), operators, and braces.
  • it does not begin or end with an operator
  • it contains valid number of operands (ie 2 in this case) for every operator