150. Evaluate Reverse Polish Notation
# Medium
Solution:
traversal all elements of the list
if it's a number, push to stack
if it's a notation, pop two numbers and compute, then push back to stack
如果用python则不能用recursive来做,因为python不能传递reference,意味着函数的参数无法成为全局变量,而导致一直在变
Time = , space =
Last updated
Was this helpful?