Member Avatar

I am trying to do some arithmetic operation on a stack but I am little confused on how would I implement it. For instance I have a statement: add(multiply(2,3),4) which is equal to 2x3 = 6 + 4 = 10. If I place this on the stack, it would look something like this: ) 4 ) 3 2 ( multiply ( add My question how would I implement the above function here. In other words what should I do to make the program interpret the paranthesis in the right way, i.e. if you pop out 4, then 3, and then …

+0 forum 0

The End.