There are two algorithms for evaluating an expression:
- stack.cpp - by stack
- recursive.cpp - by recursive function
$ g++ stack.cpp && ./a.out
infix : 1*(2+3/4)
postfix : 1234/+*
evaluate: 2
$ g++ recursive.cpp && ./a.out
infix : 1*(2+3/4)
evaluate: 2