According to this algorithm: http://en.wikipedia.org/wiki/Shunting-yard_algorithmwhen a left parenthesis is found, it is inserted into the stack, and when a right parenthesis is found, we pop all operands up to the left parenthesis. Neither parenthesis is included in the output.But what if I want expressions such as function(x) + 5 or array[x] + 5? How would the algorithm work when '(', ')', '[', ']' are seen as operands?Can someone show me the prefix version of, say, a[x] + 5?
Infix to prefix
algorithms;binary trees