Hi there,

I have a basic question on the 'point' of expression trees.

I have created one, using the code example from HERE.

After creating 3 nodes, lets say two containing integers and one containing ^U to represent a union operator.

Now, I then use an std::stack and push these nodes onto the stack in postfix order, resulting in:

1 [1]

2 [2]

3 [^U]

So as I run through the stack, I end up with 1 2 ^U, ie: postfix notation.

My question is then this, why would I use the expression tree in the first place, am I missing the point with this?

My understanding is that yes, I have 3 nodes on the heap, and I need to use a stack in order to put them into postfix order, so where does the expression tree come into play?

I'm clearly not understanding the overall concept of their 'point', so I'm hoping someone could tell me, perhaps I don't need a stack at all? But my thoughts are that I do, in order to create the postfix ordering of the expression.

Thanks for any help in helping me to understand the concept.