Pergunta de entrevista da empresa IBM

How to create a calculator that gets a string as an input. for example "2+3*4-(4+5)*3"?

Resposta da entrevista

Sigiloso

13 de jun. de 2012

Have two stacks(LIFO). one stacks holds all the mathematical actions. The other stack holds the numbers. Take out 2 top most numbers and do the first topmost math action and push result back into the stack