# problem in binary expression tree

• 04-27-2002
hanij
problem in binary expression tree
I have a problem in buildding a binary expression tree. the expression could look such as "a+(b*c)/d" . so please if you can give some hints i'll be thankfull.
• 04-28-2002
Shiro
What is the problem?
• 04-28-2002
stautze
Do you have to write the code for the tree?
• 04-28-2002
hanij
well the problem is ( I can't write the code to build this expression tree ), by the way i wrote the code to calculate this expression tree, but till now i couldn't write the code to build this tree. you know that in an expression tree the root node should be an operator in the middle of the expression, ex. [a+(b*c) the root node must be +, then the node to the left of it i put (a) and the node to the right of the root i put (*) to the left (b) and finally (c) to the right.] a friend of mine told me that i should use two Stacks one for opertaors and the other for the operands, but it didn't work right
• 04-28-2002
Prelude
This question was answered not too long ago.
http://www.cprogramming.com/cboard/s...xpression+tree

-Prelude
• 04-28-2002
hanij
thanx Prelude
am a new member, so i don't know what has been posted in the past. anyway this answers all my questions. thanx man
• 04-28-2002
hanij
hey....any one have another way to build a binary expression tree please post it here .... 'cause i'll learn how others could think and solve problems.