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.
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.
What is the problem?
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
This question was answered not too long ago.
http://www.cprogramming.com/cboard/s...xpression+tree
-Prelude
My best code is written with the delete key.
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
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.