Hey guys and gals,
Got a problem with my conversion tool. I am converting a postfix expression to a prefix expression via
p2p([12,13,+,4,1,-,/], etc ...)
which uses a stack.
I've gotten to the point where I almost get a correct answer ie:
X = [[/,[+,12,13],[-,4,1]]]
Yes
?-
Ok, so this whole list "[/,[+,12,13],[-,4,1]]" is the top element of the stack, which is returned if successfull
My question is, how can I just have it so it's
X = [/,+,12,13,-,4,1]
Yes
Notice how all lists were sorta "merged" and pushed onto the stack in reverse order? Is there an easy way to do that? Thanx
Got a problem with my conversion tool. I am converting a postfix expression to a prefix expression via
p2p([12,13,+,4,1,-,/], etc ...)
which uses a stack.
I've gotten to the point where I almost get a correct answer ie:
X = [[/,[+,12,13],[-,4,1]]]
Yes
?-
Ok, so this whole list "[/,[+,12,13],[-,4,1]]" is the top element of the stack, which is returned if successfull
My question is, how can I just have it so it's
X = [/,+,12,13,-,4,1]
Yes
Notice how all lists were sorta "merged" and pushed onto the stack in reverse order? Is there an easy way to do that? Thanx