Amazon Interview Question

Devise an eval() method for numerical expressions such as + x - / given a string containing brackets and parenthesis. I.E. "(3 * 6) + [(2/4) - 1]"

Interview Answer

Anonymous

Aug 6, 2013

Just use two stacks to implement the question, one for numbers, and the other is for operators.