anserwaseem / infix-to-postfix

Stack implementation with conversion of Infix expression to Postfix.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

infix-to-postfix

C++ template-based stack implementation with following features;

  • Paramterized constructor
  • getSize, which returns size of the stack.
  • isEmpty, which tells either stack is empty or not.
  • topp, which assigns the top-most value of stack to the given value.
  • push
  • pop

Using stack, following functions are implemented:

  • isBalanced function, which takes a string as paramter and tells either it is balanced or not (by using stack).
  • reverse function, which takes a string as a parameter and returns a reversed string (by using stack).
  • INtoPOST function, which takes a string as a parameter and uses precedence function along with stack to convert the given INFIX expression into POSTFIX espression.