Expression Evaluation

Consider a pseudo code which takes following expression as input and produces given outputs.

Input Output

[ 0 ] 0
[ 1 ] 1
[ 0, 1 ] 1
[ 1, 1 ] 2
[ 1, [ 1, 2 ] ] -2
[ 1, 2, [ 8 ] ] -5
[ 1, [ 2 ], [ 3 ] ] -4
[ 9, [ 3, 4, [ [ 2 ] ] ] ] 0

Design a function/methos to implement above pseudo code by following prototype as int ExpressEval(char * expression);

int ExpressEval(char * expression);
Last edited on
where's the pseudo code?
Last edited on
This is the second post where you haven't asked a question at all, just expected someone to do your work for you. Grow up and stop wasting people's time here if you don't have a specific question. We're not here to do your homework for you.
ya exactly sir....i have doubt that how do we use stack in the program....because i know the logic of the code....
its that for evry '[' except the 1st one, the inner values are subtracted from the previous.....
for eg.
in [1,[2],[3]] otput is............1-2 =-1 and -1-3 = -4
so i kno that....
i just need help in how do i read the expression from left to right......
Topic archived. No new replies allowed.